nav tweaks

This commit is contained in:
anarsec 2024-11-21 17:31:04 -05:00
parent 6715821694
commit 2ff9666bad
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View file

@ -584,6 +584,7 @@ a
li.lang-switcher li.lang-switcher
list-style: none list-style: none
cursor: pointer
.lang-switcher .lang-switcher-icon .lang-switcher .lang-switcher-icon
width: 1.25rem width: 1.25rem
@ -596,6 +597,7 @@ li.lang-switcher
text-align: center text-align: center
left:50% left:50%
transform: translatex(-50%) !important transform: translatex(-50%) !important
margin-top: 0.55rem
.dropdown-content .dropdown-content
position: absolute !important position: absolute !important

View file

@ -1,5 +1,4 @@
<li class="lang-switcher navbar-item"> <details class="dropdown lang-switcher navbar-item navbar-link is-arrowless has-text-weight-semibold">
<details class="dropdown">
<summary class="nav" role="button" aria-haspopup="true" title="{{ trans(key="language_selection", lang=lang) }}" aria-label="{{ trans(key="language_selection", lang=lang) }}"> <summary class="nav" role="button" aria-haspopup="true" title="{{ trans(key="language_selection", lang=lang) }}" aria-label="{{ trans(key="language_selection", lang=lang) }}">
<span class="lang-switcher-icon icon is-small"> <span class="lang-switcher-icon icon is-small">
<img src="/images/globe.png"> <img src="/images/globe.png">
@ -10,7 +9,6 @@
{{ trans(key="language_name", lang=lang) | upper }} {{ trans(key="language_name", lang=lang) | upper }}
{#- Loop through all the available languages in the config -#} {#- Loop through all the available languages in the config -#}
{%- for lcode, ldetails in config.languages -%} {%- for lcode, ldetails in config.languages -%}
<div>
{#- Skip the current language to avoid linking to the current page -#} {#- Skip the current language to avoid linking to the current page -#}
{%- if lang == lcode -%} {%- if lang == lcode -%}
{%- continue -%} {%- continue -%}
@ -31,8 +29,6 @@
{#- If it's not, replace the current language code in the URL with the new one -#} {#- If it's not, replace the current language code in the URL with the new one -#}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to='/' ~ lcode ~ '/') }}">{{ lcode | upper }}</a> <a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to='/' ~ lcode ~ '/') }}">{{ lcode | upper }}</a>
{%- endif -%} {%- endif -%}
</div>
{%- endfor -%} {%- endfor -%}
</div> </div>
</details>
</li> </li>