summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 27ca3f4..6c0a1a3 100644
--- a/Makefile
+++ b/Makefile
@@ -22,15 +22,17 @@ all: $(HTML)
%.html: %.md
@echo $@
- @PAGETITLE=$$(sed '/^#/q' $< | sed 's/:[a-z]*://; s/#* //'); \
+ @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)" > $@
+ | pandoc $(PANDOC_ARGS) -M pagetitle="$$PAGETITLE | $(TITLE)" -M description="$$DESCRIPTION" > $@
index.html: index.md blog/preview.md
@echo $@
- @sed "/Recent blog posts/r blog/preview.md" $< \
+ @DESCRIPTION=$$(sed '2,/^$$/!d' $< | tr '\n' ' '); \
+ sed "/Recent blog posts/r blog/preview.md" $< \
| sed "$(LINK_SEDSTRING) $(EMOJI_SEDSTRING)" \
- | pandoc $(PANDOC_ARGS) -M pagetitle="$(TITLE)" > $@
+ | pandoc $(PANDOC_ARGS) -M pagetitle="$(TITLE)" -M description="$$DESCRIPTION"> $@
blog/preview.md: blog/index.md
@echo $@