3ugen
August 3, 2021, 8:41am
1
Hi Zola people / Vincent,
I try to add some features with my site,
how can i use macros with Zola, like this:
{% macro breadcrumb(items) %}
{% endmacro breadcrumb %}
and function:
{% block breadcrumb %}
{{ breadcrumb_macros::breadcrumb(
items=[{“url1”:“urlName1”, {“url2”:“urlName2”} }
) }}
{% endblock breadcrumb %}
I read Tera docs, but can’t figure it out, examples only with array of strings
keats
August 3, 2021, 9:32am
2
It’s not supported in Tera currently
3ugen
August 3, 2021, 9:40am
3
ok keats, thank you
I thought I do something wrong,
because on Tera main page there is example
{% for user in users -%}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{%- endfor %}
keats
August 3, 2021, 1:46pm
4
The example works, it’s the literal dict support ([{“url1”:“urlName1”, {“url2”:“urlName2”} }]
) that is not implemented in Tera.
3ugen
August 3, 2021, 2:41pm
5
Tera or Zola?
in Tera playground everything work
https://tera.netlify.app/playground/
i guess i should read the sources,
my goal is to create a tab bar based on a macro component and switch active tab for current page by component config
thank you
keats
August 4, 2021, 11:02am
6
This example doesn’t use dict literals though?