From 529ad25479662ba8c861b4c2d9233b15190b9400 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 14 Aug 2021 00:15:25 +0300 Subject: feat(seo): add page meta description --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 $@ -- cgit v1.2.3