mylloon.fr/data/blog/posts/Makefile

20 lines
441 B
Makefile

MKDIR = mkdir -p
TOUCH = touch
PRINT = echo
DATE = $(shell date '+%d-%m-%Y')
DIR = $(shell date '+%Y/%m')
PH := new
new:
$(MKDIR) $(DIR) 2> /dev/null
$(TOUCH) $(DIR)/$(PH).md
$(PRINT) "---" > $(DIR)/$(PH).md
$(PRINT) "publish: false" >> $(DIR)/$(PH).md
$(PRINT) "date: $(DATE)" >> $(DIR)/$(PH).md
$(PRINT) "draft: true" >> $(DIR)/$(PH).md
$(PRINT) "---" >> $(DIR)/$(PH).md
help:
$(PRINT) "make PH=new"