Merge branch 'main' into microformats2
1 file changed, 12 insertions(+), 0 deletions(-)
changed files
A templates/language_switcher.html
@@ -0,0 +1,12 @@ +{% if config.extra.language_switcher %} + <nav class="lang"> + {%- set language_agnostic_path = current_path | default(value="/") | replace(from='/' ~ lang ~ '/', to = '/') | trim_start_matches(pat = '/') -%} + {%- for tr in config.extra.translations %} + {%- if tr.code == lang %} + <active>{{ tr.name }}</active> + {%- else %} + <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}" hreflang="{{ tr.code }}">{{ tr.name }}</a> + {%- endif %} + {%- endfor %} + </nav> +{% endif %}