add list of tag links at the end of each recipe

This commit is contained in:
Sylvain Gauthier 2021-03-14 12:51:30 +11:00
parent 0be88c1d12
commit d42399ae92
4 changed files with 11 additions and 1 deletions

View File

@ -131,7 +131,7 @@ blog/@%.html: $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header tag_in
envsubst < templates/footer.html >> $@; \
blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header article_header article_footer footer))
blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header article_header tag_link_header tag_link tag_link_footer article_footer footer))
mkdir -p blog
TITLE="$(shell head -n1 $< | sed 's/^# \+//')"; \
export TITLE; \
@ -148,6 +148,13 @@ blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header ar
envsubst < templates/header.html > $@; \
envsubst < templates/article_header.html >> $@; \
sed -e '/^;/d' < $< | markdown -f fencedcode >> $@; \
envsubst < templates/tag_link_header.html >> $@; \
for i in $${TAGS} ; do \
TAG_NAME="$$i" \
TAG_LINK="./@$$i.html" \
envsubst < templates/tag_link.html >> $@; \
done; \
envsubst < templates/tag_link_footer.html >> $@; \
envsubst < templates/article_footer.html >> $@; \
envsubst < templates/footer.html >> $@; \

1
templates/tag_link.html Normal file
View File

@ -0,0 +1 @@
<a href="$TAG_LINK">$TAG_NAME</a>

View File

@ -0,0 +1 @@
</i></p>

View File

@ -0,0 +1 @@
<p><i> Recipe tags: