From c0d974e5ec91e8b4cfc07197a587ec8a7856ae63 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 1 May 2022 12:33:00 -0500 Subject: [PATCH] base: Set HTML title from content --- content/_index.md | 3 +++ templates/base.html | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 content/_index.md diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..83a0d92 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,3 @@ ++++ +title = "Dustin C. Hatch" ++++ diff --git a/templates/base.html b/templates/base.html index a91c373..6f00a0a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,7 +15,21 @@ rel="stylesheet" href="{{ get_url(path='style.css', trailing_slash=false) }}" /> - Dustin C. Hatch + + {%- if page is defined -%} + {{ page.title }} + {% for sec_name in page.ancestors | reverse -%} + {% set s = get_section(path=sec_name) -%} + • {{ s.title }} + {% endfor -%} + {% elif section is defined -%} + {{ section.title }} + {% for sec_name in section.ancestors | reverse -%} + {% set s = get_section(path=sec_name) -%} + • {{ s.title }} + {% endfor -%} + {% endif -%} + {% block links %}{% endblock %}