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