Skip to content

Next version#3089

Open
Keats wants to merge 26 commits into
masterfrom
next
Open

Next version#3089
Keats wants to merge 26 commits into
masterfrom
next

Conversation

@Keats
Copy link
Copy Markdown
Collaborator

@Keats Keats commented Jan 22, 2026

No description provided.

@Stebe25
Copy link
Copy Markdown

Stebe25 commented Feb 27, 2026

While trying out the next branch, I noticed a couple of things:

get_url for static files is broken in multilingual sites (e.g. path="style.css"): zola prepends "lang/" to the path if the page/section lang is not the default language.

Components sometimes wrap their output (or parts of it) in <pre><code> </code></pre>, if there is a tab before the html tag; e.g. after "%}" or empty lines:

{% component wraps_in_pre_code() %}
	<p>tab => wrapped in pre-code</p>
<p>no tab  => not wrapped</p>
	<p>tab => not wrapped</p>

	<p>tab => wrapped in pre-code</p>
{% if x %}{% endif %}
	<p>tab => wrapped in pre-code</p>
{% if x %}{% endif -%}
	<p>tab => not wrapped</p>
{% endcomponent %}

Macros had access to the config and lang variables, while components do not (config and lang are therefore not available in templates included in components).

@Keats
Copy link
Copy Markdown
Collaborator Author

Keats commented Feb 27, 2026

Thanks for trying!

get_url for static files is broken in multilingual sites (e.g. path="style.css"): zola prepends "lang/" to the path if the page/section lang is not the default language.

I just pushed a commit to fix that, good catch!

Components sometimes wrap their output (or parts of it) in

 
, if there is a tab before the html tag; e.g. after "%}" or empty lines:

That's sadly a CommonMark "feature". Things that are indented by 4 spaces are considered a code block. I'm very tempted to fork pulldown-cmark and remove that as it just causes issues non stop.

Macros had access to the config and lang variables, while components do not (config and lang are therefore not available in templates included in components).

Do you mean shortcodes? You can pass it explicitly to the components that need it eg {{ <component config lang /> }} assuming the components parameters are called config/lang.

@Stebe25
Copy link
Copy Markdown

Stebe25 commented Feb 28, 2026

That's sadly a CommonMark "feature". Things that are indented by 4 spaces are considered a code block. I'm very tempted to fork pulldown-cmark and remove that as it just causes issues non stop.

Thanks, now that I know that, I can simply change my tab spaces or simply use -%}, but could be quite annoying for someone who doesn't know that.

Macros had access to the config and lang variables, while components do not (config and lang are therefore not available in templates included in components).

Do you mean shortcodes? You can pass it explicitly to the components that need it eg {{ <component config lang /> }} assuming the components parameters are called config/lang.

I haven't used components much, because I ran into the CommonMark "feature", but from what I've seen, they turned out really nice! I mean shortcodes too, but macros also had access to these variables without explicitly passing them. Just thought to mention it, because it was useful if you don't have to pass config and lang around (almost) everywhere.
For most use cases lang is probably not that important anymore since the trans function no longer needs the currently mandatory "lang=lang" to get the translation (in multilingual sites). The num_format filter still needs a locale argument though.

I forgot to mention that {{ __tera_context }} no longer works. And the filters num_format and markdown are "unknown".

@Keats
Copy link
Copy Markdown
Collaborator Author

Keats commented Feb 28, 2026

macros also had access to these variables without explicitly passing them

Hmm no macros were the same as components, you wouldn't get anything outside of what is defined in the macro parameter

I forgot to mention that {{ __tera_context }} no longer works.

😕 there's even a test for that! do you have a sample template where it fails?

* register num_format and markdown filter

* register num_format and markdown filter

* register num_format and markdown filter
@Stebe25
Copy link
Copy Markdown

Stebe25 commented Mar 1, 2026

I forgot to mention that {{ __tera_context }} no longer works.

😕 there's even a test for that! do you have a sample template where it fails?

Sure, works on version <= 0.22, but fails for 0.23.
tera_context.zip

@Keats
Copy link
Copy Markdown
Collaborator Author

Keats commented Mar 2, 2026

Ok found the issue: Keats/tera2#103
I'll publish a new alpha later today

Keats and others added 9 commits March 5, 2026 10:54
Co-authored-by: Asher Bernstein-Meachum <dev.asherbm.untracked946@passinbox.com>
* feat: get_page optional param allow_missing

Signed-off-by: Lazaro O'Farrill <lazaroofarrill@gmail.com>

* feat: get_section optional param allow_missing

Signed-off-by: Lazaro O'Farrill <lazaroofarrill@gmail.com>

---------

Signed-off-by: Lazaro O'Farrill <lazaroofarrill@gmail.com>
* test: consolidate accent term assertion into existing test (per @Keats review)

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>

* style: apply rustfmt

Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>

---------

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
Co-authored-by: SAY-5 <SAY-5@users.noreply.github.com>
Co-authored-by: SAY-5 <saiasish.cnp@gmail.com>
Sim-hu and others added 3 commits May 12, 2026 19:37
Add `#[serde(deny_unknown_fields)]` to the `Highlighting` struct so
that typos like `extra_grammar` (instead of `extra_grammars`) produce
a clear error at config load time.

The `#[serde(flatten)]` on `HighlightConfig` was incompatible with
`deny_unknown_fields`, so the theme configuration is now represented
as explicit `theme`, `light_theme`, and `dark_theme` Option fields
with validation in `init()`.

Closes #3127
…3156)

* Fix Create notifications on Windows; Fix Remove notifications

* Run cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants