summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2021-06-16 16:18:47 +0200
committerWolfgang Müller2021-06-16 17:04:24 +0200
commitf28cb705310ff890c34ff45217b7870bcab5a66a (patch)
treef0f980f1496cadcb75b8ba09bff02bbde53129ff
parent7fb5c0f88274637df2974fd06b8d9a6b42969d83 (diff)
downloadzunzuncito-f28cb705310ff890c34ff45217b7870bcab5a66a.tar.gz
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.
-rw-r--r--templates/atom.xml2
-rw-r--r--templates/base.html2
-rw-r--r--templates/macros.html2
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 %}
<entry xml:lang="{{ page.lang }}">
<author><name>{{ config.extra.author }}</name></author>
- <title>{{ page.title | default(value="Post № " ~ page.slug)}}</title>
+ <title>{{ page.title }}</title>
<published>{{ page.date | date(format="%+") }}</published>
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
<link href="{{ page.permalink | safe }}" type="text/html"/>
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 @@
<div class="info">
<a class="bold-hover" title="permalink to this post" href="{{ post.permalink }}">{% if mention %}№ {{ post.slug }} {% else %}§{% endif %}</a>
<time class="mute" datetime="{{ post.date }}" title="{{ post.date }}">{{ post.date | date(format="%F %R") }}</time>
- {%- if class != "single" and post.title %}<h2 class="mute">{{ post.title }}</h2>{% endif %}
+ {%- if class != "single" %}<h2 class="mute">{{ post.title }}</h2>{% endif %}
</div>
{%- if "tags" in post.taxonomies %}
<nav class="tags">