Files
andwati.com/templates/taxonomy_single.html
T
andwati 3e1c643283 fix zola.toml config table scoping bug and JSON-LD safety
[[extra.menu]] silently swallowed ~20 later extra.* keys (posts_page_title,
search_placeholder, show_rss_link, notfound_*, etc.) into the last menu
entry/tag_descriptions table, since TOML absorbs bare keys into the last
open table until a new header appears. show_rss_link was the only visibly
broken one (RSS link missing from homepage); the rest were masked by
matching template defaults.

Also replaced Tera's default() filter with explicit if/else where values
feed into JSON-LD, since default()'s fallback gets escaped in a way `safe`
can't undo. Added author/dateModified to BlogPosting list entries.
2026-07-17 15:59:27 +03:00

78 lines
3.6 KiB
HTML

{% extends "base.html" %} {% block title %}Tag: {{ term.name }} | {{ config.title }}{% endblock
title %} {% block description %}{{ config.extra.tag_descriptions[term.slug] | default(value='Posts tagged "' ~ term.name ~ '" on ' ~ config.title) }}{% endblock
description %} {% block canonical %}{{ term.permalink }}{% endblock canonical %} {% block og_title
%}Tag: {{ term.name }} | {{ config.title }}{% endblock og_title %} {% block og_description %}{{
config.extra.tag_descriptions[term.slug] | default(value='Posts tagged "' ~ term.name ~ '" on ' ~ config.title) }}{% endblock og_description %} {% block og_url %}{{
term.permalink }}{% endblock og_url %} {% block head %}
{% set tag_ld_name = 'Posts tagged "' ~ term.name ~ '" | ' ~ config.title %}
{% set tag_ld_fallback_description = 'Posts tagged "' ~ term.name ~ '" on ' ~ config.title %}
<!-- SEO: Tag CollectionPage JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CollectionPage",
"@id": "{{ term.permalink | safe }}#collection",
"name": {{ tag_ld_name | json_encode | safe }},
"description": {% if config.extra.tag_descriptions[term.slug] %}{{ config.extra.tag_descriptions[term.slug] | json_encode | safe }}{% else %}{{ tag_ld_fallback_description | json_encode | safe }}{% endif %},
"url": "{{ term.permalink | safe }}",
"inLanguage": "en-US",
"isPartOf": {
"@type": "WebSite",
"@id": "{{ config.base_url | safe }}/#website"
},
"hasPart": [
{% for page in term.pages %}
{
"@type": "BlogPosting",
"@id": "{{ page.permalink | safe }}#article",
"headline": {{ page.title | json_encode | safe }},
"image": "{{ config.base_url | safe }}{% if page.extra.image %}{{ page.extra.image | safe }}{% else %}/images/og-image.png{% endif %}",
"url": "{{ page.permalink | safe }}",
"author": {
"@type": "Person",
"@id": "{{ config.base_url | safe }}/#author"
}
{% if page.date %},"datePublished": "{{ page.date | date(format="%+") }}"{% endif %}
{% if page.updated %},"dateModified": "{{ page.updated | date(format="%+") }}"{% elif page.date %},"dateModified": "{{ page.date | date(format="%+") }}"{% endif %}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
</script>
<!-- SEO: BreadcrumbList JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "{{ config.base_url | safe }}/" },
{ "@type": "ListItem", "position": 2, "name": "Tags", "item": "{{ config.base_url | safe }}/tags/" },
{ "@type": "ListItem", "position": 3, "name": {{ term.name | json_encode | safe }}, "item": "{{ term.permalink | safe }}" }
]
}
</script>
{% endblock head %} {% block content %}
<div class="post-detail">
<header class="post-header list-page-header">
<h1 class="post-title list-page-title"><span class="term-hash">#</span>{{ term.name }}</h1>
{% if config.extra.tag_descriptions[term.slug] %}
<p class="tag-description">{{ config.extra.tag_descriptions[term.slug] }}</p>
{% endif %}
</header>
<div class="archive-list">
<div class="archive-year">
<ul class="archive-items">
{% for page in term.pages %}
<li class="archive-item hover-scale">
<time datetime="{{ page.date }}" class="archive-date">{{ page.date | date(format="%d-%b") }}</time>
<a href="{{ page.permalink }}" class="archive-link">{{ page.title }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endblock content %}