### Makefile for Poetry # DAY := $(shell date "+%m%d") YEAR := $(shell date "+%Y") #TEMPLATE := 0template.html ENTRY := $(YEAR)/$(DAY)-$(name).html HELP := make entry name= [title=""] .PHONY: all entry all:: @echo you probably want '$(HELP)' entry: $(ENTRY) .draft # make a generic entry for today # $(ENTRY):: @if [ -z $(name) ]; then \ echo '$$(name) not defined.'; \ echo '$(HELP)'; false; \ fi mkdir -p $(YEAR) echo "$$TEMPLATE" >$@ commit: git add $(ENTRY) git commit -m "$(ENTRY) started" $(ENTRY) # make .draft point to today's post .draft:: $(ENTRY) if [ -L $@ ]; then rm $@; else true; fi ln -s $< $@ # The document template. # Note that it has to be quoted in the echo command to prevent the shell # from taking out the newlines and squashing the whitespace. # see http://stackoverflow.com/questions/649246 for more discussion. define TEMPLATE <!DOCTYPE HTML> <html><head> <title>$(title)

steve.savitzky.net / Lit / Poetry / $(YEAR) / $(DAY)-$(name)


Steve Savitzky <steve @ savitzky.net>
endef export TEMPLATE