diff options
author | Sylvain Gauthier <s94.gauthier@laposte.net> | 2021-03-14 12:51:30 +1100 |
---|---|---|
committer | Sylvain Gauthier <s94.gauthier@laposte.net> | 2021-03-15 10:36:14 +1100 |
commit | d42399ae92a56146cca72d3421816ae730c26357 (patch) | |
tree | f20a115e6806495e1dc86b4837032e77adcbf456 | |
parent | 0be88c1d121090230c4f8957df5c9a6a351dd6f3 (diff) | |
download | based.cooking-d42399ae92a56146cca72d3421816ae730c26357.tar based.cooking-d42399ae92a56146cca72d3421816ae730c26357.tar.gz based.cooking-d42399ae92a56146cca72d3421816ae730c26357.tar.lz based.cooking-d42399ae92a56146cca72d3421816ae730c26357.tar.xz based.cooking-d42399ae92a56146cca72d3421816ae730c26357.zip |
add list of tag links at the end of each recipe
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | templates/tag_link.html | 1 | ||||
-rw-r--r-- | templates/tag_link_footer.html | 1 | ||||
-rw-r--r-- | templates/tag_link_header.html | 1 |
4 files changed, 11 insertions, 1 deletions
@@ -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 >> $@; \ diff --git a/templates/tag_link.html b/templates/tag_link.html new file mode 100644 index 000000000..49cc68ce5 --- /dev/null +++ b/templates/tag_link.html @@ -0,0 +1 @@ +<a href="$TAG_LINK">$TAG_NAME</a> diff --git a/templates/tag_link_footer.html b/templates/tag_link_footer.html new file mode 100644 index 000000000..38bf9e7de --- /dev/null +++ b/templates/tag_link_footer.html @@ -0,0 +1 @@ +</i></p> diff --git a/templates/tag_link_header.html b/templates/tag_link_header.html new file mode 100644 index 000000000..c56658589 --- /dev/null +++ b/templates/tag_link_header.html @@ -0,0 +1 @@ +<p><i> Recipe tags: |