misc:zola_tips
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
misc:zola_tips [2022/12/25 22:20] – [Breadcrumbs] mithat | misc:zola_tips [2022/12/25 22:57] (current) – [Sections and _index.md] mithat | ||
---|---|---|---|
Line 23: | Line 23: | ||
'' | '' | ||
- | You don't need to have a '' | + | You don't need to have a '' |
You can nest sections. | You can nest sections. | ||
Line 141: | Line 141: | ||
No doubt, there are opportunities to stuff some of this into macros and/or partials and/or similar. | No doubt, there are opportunities to stuff some of this into macros and/or partials and/or similar. | ||
===== Breadcrumbs ===== | ===== Breadcrumbs ===== | ||
- | See this [[https:// | + | See this [[https:// |
<code twig> | <code twig> | ||
{% block breadcrumb %} | {% block breadcrumb %} | ||
<div class=" | <div class=" | ||
- | | + | |
- | {% set current = section | default(value=page) %} | + | {% set current = section | default(value=page) %} |
- | {% for ancestor in current.ancestors %} | + | {% for ancestor in current.ancestors %} |
{% if loop.first %} | {% if loop.first %} | ||
- | | + | |
{% endif %} | {% endif %} | ||
<span class=" | <span class=" | ||
{% set section = get_section(path=ancestor) %} | {% set section = get_section(path=ancestor) %} | ||
<a class=" | <a class=" | ||
- | | + | |
- | <span class=" | + | <span class=" |
- | <a class=" | + | <a class=" |
</ | </ | ||
{% endblock breadcrumb %} | {% endblock breadcrumb %} | ||
</ | </ |
misc/zola_tips.txt · Last modified: 2022/12/25 22:57 by mithat