mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-01-09 20:21:06 +01:00
Try support multi langs
This commit is contained in:
parent
7f630a4e31
commit
360a6f6207
|
@ -1,6 +1,7 @@
|
|||
{% import "macros/date.html" as date_macros -%}
|
||||
{% import "macros/head.html" as head_macros -%}
|
||||
{% import "macros/menu.html" as menu_macros -%}
|
||||
{% import "macros/language_menu.html" as language_menu_macros -%}
|
||||
{% import "macros/post.html" as post_macros -%}
|
||||
{% import "macros/title.html" as title_macros -%}
|
||||
|
||||
|
@ -57,6 +58,9 @@
|
|||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{%- if page %}
|
||||
{{ language_menu_macros::menu(page=page) }}
|
||||
{% endif -%}
|
||||
</div>
|
||||
|
||||
{% block header_menu %}
|
||||
|
|
12
templates/macros/language_menu.html
Normal file
12
templates/macros/language_menu.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% macro menu(page) %}
|
||||
<ul class="menu menu--desktop menu--language-selector">
|
||||
<li class="menu__trigger">Language ▾</li>
|
||||
<li>
|
||||
<ul class="menu__dropdown">
|
||||
{%- for item in page.translations %}
|
||||
<li><a href="{{ item.permalink }}">{{ item.lang }}</a></li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{% endmacro menu %}
|
Loading…
Reference in a new issue