summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-04-21 19:57:22 +0300
committereug-vs <eugene@eug-vs.xyz>2022-04-21 19:57:22 +0300
commit5b364613210c8b7186f63401e9ab96001e99c8a0 (patch)
tree31b19d2aac2fbc4412ef447b04bf77922934a740
parent06c8229e692f3e0ea8813b31cdd624ad69082269 (diff)
downloadbenzin-5b364613210c8b7186f63401e9ab96001e99c8a0.tar.gz
feat: add description
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 67f46a5..82f8f2f 100644
--- a/Makefile
+++ b/Makefile
@@ -37,12 +37,13 @@ EMOJI_SOURCES=$(wildcard src/public/emoji/*)
all: $(HTML) $(RSS) $(PUBLIC)
-out/%.html: tmp/%.content.html tmp/%.meta.title $(PAGE_TEMPLATE) $(OPENRING_FOOTER)
+out/%.html: tmp/%.content.html tmp/%.meta.title tmp/%.meta.description $(PAGE_TEMPLATE) $(OPENRING_FOOTER)
@mkdir -p $(@D)
sed "/<\/main>/e cat $< $(OPENRING_FOOTER)" $(PAGE_TEMPLATE) > $@
sed -i \
-e '/<head>/{' \
-e 'a <title>' -e "r tmp/$*.meta.title" -e 'a <\/title>' \
+ -e 'a <meta name="description" content="' -e "r tmp/$*.meta.description" -e 'a "/>' \
-e '}' $@
tmp/%.content.html: src/%.md tmp/emoji.sed
@@ -68,6 +69,10 @@ tmp/%.meta.title: src/%.md
sed '/^#/q' $< | sed 's/#* //' > $@
@echo "| $(WEBSITE_TITLE)" >> $@
+tmp/%.meta.description: src/%.md
+ @mkdir -p $(@D)
+ sed '2,/^$$/!d' $< > $@
+
tmp/blog/%.meta.date: src/blog/%.md
@mkdir -p $(@D)
@date --rfc-email -d $* > $@