diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -5,6 +5,7 @@ MARKDOWN=gfm+emoji STYLESHEET=/style.css HEAD=head.html HEADER=header.html +OPENRING_FOOTER=footer.html PANDOC_ARGS=-s --from=$(MARKDOWN) --to=html -c $(STYLESHEET) -B $(HEADER) -H $(HEAD) -M lang="en" --shift-heading-level-by=1 --highlight-style=gruvbox.theme LINK_SEDSTRING=s/.md)/.html)/g; @@ -12,6 +13,8 @@ EMOJI_SEDSTRING=$(shell ./compile_emoji_sedstring.sh) LOCALIZE_SEDSTRING=s|\"/|\"$(PWD)/|; UNLOCALIZE_SEDSTRING=s|$(PWD)||; +OPENRING_FEED="https://drewdevault.com/feed.xml" + SOURCES=$(wildcard *.md blog/*.md articles/*.md) HTML=$(patsubst %.md, %.html, $(SOURCES)) @@ -19,12 +22,12 @@ HTML=$(patsubst %.md, %.html, $(SOURCES)) all: $(HTML) -%.html: %.md +%.html: %.md $(OPENRING_FOOTER) @echo $@ @DESCRIPTION=$$(sed '2,/^$$/!d' $< | tr '\n' ' '); \ PAGETITLE=$$(sed '/^#/q' $< | sed 's/:[a-z]*://; s/#* //'); \ sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" $< \ - | pandoc $(PANDOC_ARGS) -M pagetitle="$$PAGETITLE | $(TITLE)" -M description="$$DESCRIPTION" > $@ + | pandoc $(PANDOC_ARGS) -M pagetitle="$$PAGETITLE | $(TITLE)" -A $(OPENRING_FOOTER) -M description="$$DESCRIPTION" > $@ index.html: index.md blog/preview.md @echo $@ @@ -33,6 +36,9 @@ index.html: index.md blog/preview.md | sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" \ | pandoc $(PANDOC_ARGS) -M pagetitle="$(TITLE)" -M description="$$DESCRIPTION"> $@ +$(OPENRING_FOOTER): openring-template.html + openring -s $(OPENRING_FEED) < $< > $@ + blog/preview.md: blog/index.md @echo $@ @sed -n "s/^-/ -/; s|(|(blog/| ; /^ -/p" $< | head -n 4 > $@ @@ -51,5 +57,5 @@ unlocalize: $(HTML) @for file in $^; do sed -i "$(UNLOCALIZE_SEDSTRING)" $$file; done clean: - rm -f $(HTML) blog/preview.md + rm -f $(HTML) $(OPENRING_FOOTER) blog/preview.md |