summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2021-08-14 00:15:25 +0300
committereug-vs <eugene@eug-vs.xyz>2021-08-14 00:15:25 +0300
commit529ad25479662ba8c861b4c2d9233b15190b9400 (patch)
treeddec677917630f8465cd4fe4b3e1c68f571ef52a /Makefile
parent4fa5a63695f30813723530b9cf63d197a1696c7a (diff)
downloadeug-vs-xyz-529ad25479662ba8c861b4c2d9233b15190b9400.tar.gz
feat(seo): add page meta description
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 $@