From 6cceafb21bc1bd519bc6111aeba7ad372f3e9037 Mon Sep 17 00:00:00 2001 From: finga Date: Wed, 15 Feb 2023 05:22:13 +0100 Subject: [PATCH] templates: Generate more specific page titles --- templates/base.html | 2 +- templates/credits.html | 4 ++++ templates/index.html | 4 ++++ templates/page.html | 5 +++++ templates/section.html | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 232a8b3..a2c2939 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,7 +4,7 @@ - {{ config.title }} + {% block title %}{% endblock title %} {% if config.generate_feed %} diff --git a/templates/credits.html b/templates/credits.html index 50ab1ac..35fa3d7 100644 --- a/templates/credits.html +++ b/templates/credits.html @@ -1,5 +1,9 @@ {% extends "base.html" %} +{% block title %} +{{ config.title }} - {{ page.title }} +{% endblock title %} + {% block content %}

{{ config.title }}

{{ page.title }}

diff --git a/templates/index.html b/templates/index.html index 7c03502..d059f77 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,9 @@ {% extends "base.html" %} +{% block title %} +{{ config.title }} +{% endblock title %} + {% block content %}

{{ config.title }}

diff --git a/templates/page.html b/templates/page.html index 9330515..6c54f04 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,10 @@ {% extends "base.html" %} +{% block title %} +{% set section = get_section(path=page.ancestors | last) %} +{{ config.title }} - {{ section.title }} - {{ page.title }}: {{ page.date }} +{% endblock title %} + {% block content %} {% set section = get_section(path=page.ancestors | last) %}

{{ config.title }}

diff --git a/templates/section.html b/templates/section.html index b891e25..56edc0a 100644 --- a/templates/section.html +++ b/templates/section.html @@ -1,5 +1,9 @@ {% extends "base.html" %} +{% block title %} +{{ config.title }} - {{ section.title }} +{% endblock title %} + {% block content %}

{{ config.title }}

{{ section.title }}