Files
andwati.com/templates/index.html
T
andwati e992baf2d2 Migrate templates to Zola 0.23 / Tera v2
bin/update-zola always installs the latest release, which as of
v0.23.0 rewrote the template engine to Tera v2. That broke the whole
site: removed filters (slice, concat, escape), test calls now require
named args, shortcodes are gone in favor of Tera components, and
content itself is now Tera-templated before markdown runs.

- slice(end=n) -> native [:n] slicing; concat(with=x) -> spread [...arr, x]
- escape -> escape_html; starting_with/containing -> named `pat` arg
- get_taxonomy_url `name` -> `term` (old name is deprecated)
- %+ date format no longer recognized; replaced with explicit RFC3339 pattern
- shortcodes (note/tip/warning/danger/youtube) rewritten as components;
  content call sites updated to component invocation syntax
- {% include %} no longer inherits for-loop-local variables (only ambient
  page/section context) - post-card.html converted to a component that
  takes page/index explicitly instead of relying on implicit `page`/`loop`
- two content code blocks with literal Jinja-style {{ }} syntax (Netlify
  CMS config, a Flask template snippet) wrapped in {% raw %} so Tera
  doesn't try to render them, since content is now templated too
- fixed a real content corruption bug along the way: the youtube
  shortcode's multi-line <iframe> tag had a conditional that could
  collapse to a whitespace-only line, which prematurely closed the
  HTML block under CommonMark rules and got the rest of the tag
  syntax-highlighted as code instead of rendered

Verified with a clean `zola build` and `zola serve` on v0.23.1, plus a
spot-check of the rendered HTML for both callouts and the video embed.
`zola check` only reports pre-existing external link rot, unrelated to
this change.
2026-08-07 10:46:09 +03:00

51 lines
2.2 KiB
HTML

{% extends "base.html" %} {% block canonical %}{{ config.base_url }}/{% endblock canonical %} {%
block og_url %}{{ config.base_url }}/{% endblock og_url %} {% block head %}
<!-- SEO: Blog (Homepage) JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Blog",
"@id": "{{ config.base_url | safe }}/#blog",
"name": {{ config.title | json_encode | safe }},
"description": {{ config.description | json_encode | safe }},
"url": "{{ config.base_url | safe }}/",
"inLanguage": "en-US",
"author": {
"@type": "Person",
"@id": "{{ config.base_url | safe }}/#author"
},
"blogPost": [
{% set section = get_section(path="posts/_index.md") %}
{% for page in section.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="%Y-%m-%dT%H:%M:%S%:z") }}"{% endif %}
{% if page.updated %},"dateModified": "{{ page.updated | date(format="%Y-%m-%dT%H:%M:%S%:z") }}"{% elif page.date %},"dateModified": "{{ page.date | date(format="%Y-%m-%dT%H:%M:%S%:z") }}"{% endif %}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
</script>
{% endblock head %} {% block content %} {% include "partials/profile.html" %}
{% set section = get_section(path="posts/_index.md") %}
<h2 class="feed-heading">{{ config.extra.homepage_feed_heading | default(value="Latest") }}</h2>
<div class="post-feed-list">
{% set post_limit = config.extra.homepage_post_limit | default(value=3) %}
{% for page in section.pages[:post_limit] %} {{<post_card page={page} index={loop.index} />}} {% endfor %}
</div>
<div class="view-all-posts">
<a href="/posts" class="btn-view-all">{{ config.extra.view_all_posts_label | default(value="View all posts") }}</a>
</div>
{% endblock content %}