github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/templates/Makefile (about) 1 # Directory containing mjml templates 2 OUTPUT_DIR=. 3 MJML=mjml 4 5 check-prereq: ## check if mjml is installed 6 @if ! [ -x "$$(command -v mjml)" ]; then \ 7 echo "mjml is not installed. Installing mjml"; \ 8 npm install -g mjml; \ 9 fi; 10 11 12 build: check-prereq ## Compile all mjml email templates 13 @for f in $(shell ls *.mjml); \ 14 do \ 15 echo "{{define \"$${f%.*}\"}}\n" > $(OUTPUT_DIR)/$${f%.*}.html; \ 16 $(MJML) $${f} -s >> $(OUTPUT_DIR)/$${f%.*}.html; \ 17 echo "\n{{end}}" >> $(OUTPUT_DIR)/$${f%.*}.html; \ 18 done