0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00
penpot/docs/_includes/layouts/plugins-home.njk
2024-10-30 13:30:02 +01:00

27 lines
703 B
Text

---
layout: layouts/base.njk
templateClass: tmpl-plugins-guide
---
{%- macro show_children(item) -%}
{%- for child in item | children | sorted('data.title') %}
{%- if loop.first -%}<ul>{%- endif -%}
<li>
<a href="{{ child.url }}">{{ child.data.title }}</a>
{%- if page.url.includes(child.url) -%}
{{ show_children(child) }}
{%- endif -%}
{%- if child.url == page.url -%}
{{ content | toc(tags=['h2', 'h3']) | stripHash | safe }}
{%- endif -%}
</li>
{%- if loop.last -%}</ul>{%- endif -%}
{%- endfor %}
{%- endmacro -%}
<div class="main-container">
<content class="main-content plugins">
{{ content | safe }}
</content>
</div>