all repos — zola-bearblog @ fa345b1d1e11cc66ed92605382887fd4367ef97a

Port of bear blog theme to zola

Make language switcher more semantic

Alan Pearce
commit

fa345b1d1e11cc66ed92605382887fd4367ef97a

parent

f138825a20271b4c117ddd42ea6749a4378a9efb

1 file changed, 2 insertions(+), 2 deletions(-)

jump to
M templates/language_switcher.htmltemplates/language_switcher.html
@@ -1,11 +1,11 @@
{% if config.extra.language_switcher %} - <nav> + <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 %} <strong>{{ tr.name }}</strong> {%- else %} - <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}">{{ tr.name }}</a> + <a href="{{ get_url(path=language_agnostic_path, lang=tr.code) ~ "/" }}" hreflang="{{ tr.code }}">{{ tr.name }}</a> {%- endif %} {%- endfor %} </nav>