summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-04-21 18:02:20 +0300
committereug-vs <eugene@eug-vs.xyz>2022-04-21 18:02:20 +0300
commit06a24a58e0569d5c1cd6af27a9ac875713f023fb (patch)
tree9b57a93ee81240816003ffa12a86a9f9136256e6
parent02d6ea3076ba578f3e1bb4859a1089c01b03c185 (diff)
downloadbenzin-06a24a58e0569d5c1cd6af27a9ac875713f023fb.tar.gz
feat: add RSS metadata
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d47b458..9f21e63 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# BENZIN Makefile
WEBSITE_URL=https://example.com
-WEBSITE_TITLE="Example Website"
+WEBSITE_TITLE=Example Website
CONVERT=pandoc --from=gfm+emoji --to=html --section-divs --shift-heading-level-by=1
PAGE_TEMPLATE=templates/page.html
@@ -59,6 +59,12 @@ tmp/index.meta.title:
$(RSS): $(BLOG_XML) $(RSS_TEMPLATE)
@mkdir -p $(@D)
sed "/<\/channel>/e cat $(BLOG_XML)" $(RSS_TEMPLATE) > $@
+ sed -i \
+ -e '/<channel>/{' \
+ -e 'a <title>$(WEBSITE_TITLE)<\/title>' \
+ -e "a <link>$(WEBSITE_URL)<\/link>" \
+ -e "a <lastPubDate>$$(date --rfc-email)<\/lastPubDate>" \
+ -e '}' $@
tmp/%.xml: tmp/%.content.html tmp/%.meta.title $(RSS_ITEM_TEMPLATE)
@mkdir -p $(@D)
@@ -86,7 +92,7 @@ tmp/emoji.sed: $(EMOJI_SOURCES)
for emoji in $^; do\
basename=$$(basename $$emoji); \
name=$${basename%.*}; \
- echo "s|:$${name}:|<img src=\"/public/emoji/$${basename}\" alt=\"$${basename}-emoji\" height=\"$(EMOJI_SIZE)\" width=\"$(EMOJI_SIZE)\" style=\"$(EMOJI_STYLE)\">|g;" >> $@; \
+ echo "s|:$${name}:|<img src=\"/public/emoji/$${basename}\" alt=\"$${name}-emoji\" height=\"$(EMOJI_SIZE)\" width=\"$(EMOJI_SIZE)\" style=\"$(EMOJI_STYLE)\">|g;" >> $@; \
done
serve: $(HTML)