Skip to content

Zola 0.23 (Tera2) breaks the docs build — zola pin blocked at 0.22.1 #3827

Description

@worktrunk-bot

Zola 0.23.0 shipped Tera2 + refactoring, which replaces the templating engine. docs/ does not build under it, so the weekly CI pin bump for zola is blocked at 0.22.1 (the pin lives in ci.yaml and publish-docs.yaml). Filing rather than fixing because the replacement for macros is a design call, not a mechanical rewrite.

zola build against the official 0.23.3 x86_64-unknown-linux-gnu release binary fails on the first line of base.html:

ERROR Failed to build the site
ERROR error: Unknown tag
 --> base.html:1:4
  |
1 | {% import "macros.html" as macros %}
  |    ^^^^^^

Tera2 appears to have dropped the macro system outright — not renamed it. Probing a minimal site with the 0.23.3 binary, all four spellings fail: {% import "macros.html" as m %} and {% from "macros.html" import hello %} are both Unknown tag, {{ macros::hello(name="x") }} fails to parse at the : (Found ':' but expected }}), and even a {% macro %} block defined and called within a single template is Unknown tag. So there is no in-place substitution for ::; the shared partial has to be re-expressed some other way ({% include %} with context set at the call site is the obvious candidate, but that changes how arguments are passed).

The affected surface is small and fully enumerated:

Those three :: call sites are the only ones in docs/templates/. What is not yet known is how much else in the other ~700 lines of templates Tera2 rejects — the build aborts at line 1 of base.html, so nothing past the import has been exercised. Whoever picks this up should expect to iterate: fix the macro, rebuild, and see what the next error is. A rendered-output diff against a 0.22.1 build is worth doing at the end, since a silently-changed filter or whitespace rule would not show up as an error.

Staying on 0.22.1 is fine for now — it builds and the docs publish — so this is not urgent. It only matters that the pin stops drifting silently, which the weekly renovation will otherwise keep reporting.

Reproduction
curl -sfL -o /tmp/zola.tar.gz https://github.com/getzola/zola/releases/download/v0.23.3/zola-v0.23.3-x86_64-unknown-linux-gnu.tar.gz
tar -xzf /tmp/zola.tar.gz -C /tmp
cd docs && /tmp/zola build

Minimal probe used for the four spellings above:

mkdir -p /tmp/zt/templates /tmp/zt/content
printf 'base_url = "https://example.com"\n' > /tmp/zt/config.toml
printf '{%% macro hello(name) %%}Hi {{ name }}{%% endmacro %%}\n' > /tmp/zt/templates/macros.html
printf '{%% import "macros.html" as m %%}\n<p>{{ m::hello(name="x") }}</p>\n' > /tmp/zt/templates/index.html
/tmp/zola --root /tmp/zt build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions