nakamochi
/
website
Archived
2
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
1.1 KiB
HTML

{%- macro main_nav() %}
<ul class="mainnav">
{%- for item in config.extra.sitenav -%}
{%- set url = get_url(path=item.path, lang=lang) -%}
{%- set is_curr_url = false -%}
{%- if current_url is defined -%}
{%- set is_curr_url = url == current_url -%}
{%- endif -%}
{%- if is_curr_url %}
<li class="muted">{{item[lang]}}</li>
{%- else %}
<li><a href="{{url|safe}}">{{item[lang]}}</a></li>
{%- endif %}
{%- endfor %}
</ul>
{%- endmacro -%}
{%- macro lang_picker(transarr) -%}
{%- set currlang = lang -%}
{%- set translations = [] -%}
{%- for t in transarr -%}
{%- if t.title -%}
{%- set_global translations = translations | concat(with=t) -%}
{%- endif -%}
{%- endfor -%}
<ul class="translist">
{%- for t in translations -%}
{%- if t.lang != currlang -%}
<li><a href="{{t.permalink|safe}}" hreflang="{{t.lang}}" title="{{t.title}}">{{t.lang|upper}}</a></li>
{%- else -%}
<li>{{t.lang|upper}}</li>
{%- endif -%}
{%- else -%}
<!-- no translations -->
{%- endfor -%}
</ul>
{%- endmacro -%}