From f28cb705310ff890c34ff45217b7870bcab5a66a Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 16 Jun 2021 16:18:47 +0200 Subject: templates: Make page titles mandatory Currently we allow empty post titles, gracefully falling back to a default value. This increases complexity somewhat. Since we think we'll always be able to think of a title for a post, make it mandatory for now to provide one. --- templates/atom.xml | 2 +- templates/base.html | 2 +- templates/macros.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/atom.xml b/templates/atom.xml index ab0012c..7792b32 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -22,7 +22,7 @@ {%- for page in pages %} {{ config.extra.author }} - {{ page.title | default(value="Post № " ~ page.slug)}} + {{ page.title }} {{ page.date | date(format="%+") }} {{ page.updated | default(value=page.date) | date(format="%+") }} diff --git a/templates/base.html b/templates/base.html index 7599251..180e311 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,7 @@ {%- set description = config.description -%} {%- if page -%} - {%- set description = page.title | default(value="post № " ~ page.slug) -%} + {%- set description = page.title -%} {%- elif term -%} {%- set description = "posts tagged with #" ~ term.name -%} {%- elif terms -%} diff --git a/templates/macros.html b/templates/macros.html index 1ec8ab0..6071769 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -6,7 +6,7 @@
{% if mention %}№ {{ post.slug }} {% else %}§{% endif %} - {%- if class != "single" and post.title %}

{{ post.title }}

{% endif %} + {%- if class != "single" %}

{{ post.title }}

{% endif %}
{%- if "tags" in post.taxonomies %}