From 1d7d2b6ab801b1e8388a4d7ba751ec1e7f2729f7 Mon Sep 17 00:00:00 2001 From: Sylvain Gauthier Date: Fri, 12 Mar 2021 11:55:40 +1100 Subject: fix - Set correct title on pages (remove leading '#') - Remove main title on recipe pages - Put metadata at the end of articles --- Makefile | 12 +++++++++--- templates/article_footer.html | 1 + templates/article_header.html | 2 -- templates/footer.html | 1 + templates/header.html | 6 +----- templates/index_header.html | 4 ++++ templates/tag_index_header.html | 5 ++++- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 8aa41a3..20b82e4 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,9 @@ tags/%: $(BLOG_SRC)/%.md blog/index.html: $(ARTICLES) $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header index_header tag_list_header tag_entry tag_separator tag_list_footer article_list_header article_entry article_separator article_list_footer index_footer footer)) mkdir -p blog TITLE="$(BLOG_TITLE)"; \ + PAGE_TITLE="$(BLOG_TITLE)"; \ export TITLE; \ + export PAGE_TITLE; \ envsubst < templates/header.html > $@; \ envsubst < templates/index_header.html >> $@; \ envsubst < templates/tag_list_header.html >> $@; \ @@ -103,10 +105,12 @@ tagpages: $(TAGFILES) blog/@%.html: $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header tag_index_header tag_list_header tag_entry tag_separator tag_list_footer article_list_header article_entry article_separator article_list_footer tag_index_footer footer)) mkdir -p blog - TITLE="Articles tagged $*"; \ + PAGE_TITLE="Articles tagged $* — $(BLOG_TITLE)"; \ TAGS="$*"; \ - export TITLE; \ + TITLE="$(BLOG_TITLE)"; \ + export PAGE_TITLE; \ export TAGS; \ + export TITLE; \ envsubst < templates/header.html > $@; \ envsubst < templates/tag_index_header.html >> $@; \ envsubst < templates/article_list_header.html >> $@; \ @@ -129,8 +133,10 @@ blog/@%.html: $(TAGFILES) $(addprefix templates/,$(addsuffix .html,header tag_in blog/%.html: $(BLOG_SRC)/%.md $(addprefix templates/,$(addsuffix .html,header article_header article_footer footer)) mkdir -p blog - TITLE="$(shell head -n1 $<)"; \ + TITLE="$(shell head -n1 $< | sed 's/^# \+//')"; \ export TITLE; \ + PAGE_TITLE="$${TITLE} — $(BLOG_TITLE)"; \ + export PAGE_TITLE; \ AUTHOR="$(shell git log --format="%an" -- "$<" | tail -n 1)"; \ export AUTHOR; \ DATE_POSTED="$(shell git log --diff-filter=A --date="format:$(BLOG_DATE_FORMAT)" --pretty=format:'%ad' -- "$<")"; \ diff --git a/templates/article_footer.html b/templates/article_footer.html index e69de29..331e55b 100644 --- a/templates/article_footer.html +++ b/templates/article_footer.html @@ -0,0 +1 @@ +

Recipe posted on: $DATE_POSTED, last edited on: $DATE_EDITED, written by: $AUTHOR

diff --git a/templates/article_header.html b/templates/article_header.html index e66f98c..e69de29 100644 --- a/templates/article_header.html +++ b/templates/article_header.html @@ -1,2 +0,0 @@ -

index

-

Recipe posted on: $DATE_POSTED, last edited on: $DATE_EDITED, written by: $AUTHOR

diff --git a/templates/footer.html b/templates/footer.html index b7cd6bf..a342f92 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,6 +1,7 @@

This website is a fork from Luke Smith's Based Cooking

diff --git a/templates/header.html b/templates/header.html index 9b6f9f4..7756d4f 100644 --- a/templates/header.html +++ b/templates/header.html @@ -3,10 +3,6 @@ - $TITLE + $PAGE_TITLE - diff --git a/templates/index_header.html b/templates/index_header.html index a222e9a..0026f08 100644 --- a/templates/index_header.html +++ b/templates/index_header.html @@ -1 +1,5 @@ +

Only Based cooking. No ads, no tracking, nothing but based cooking.

diff --git a/templates/tag_index_header.html b/templates/tag_index_header.html index 2d73153..57fd89f 100644 --- a/templates/tag_index_header.html +++ b/templates/tag_index_header.html @@ -1,2 +1,5 @@ -

index

+

Filtering recipes tagged: $TAGS

-- cgit v1.2.3