diff --git a/templates/nav.html b/templates/nav.html index 71ccd6c25f9b36dd71cfc40c991f5083ef3ddbf3..e87dead4ac5f2a0c04c2841e968cde2a5b5a703e 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,17 +1,20 @@ <nav class="w3-bar w3-large"> - <a href="/" class="w3-bar-item w3-button {% if current_path %}{% if current_path == "/" %}active{% endif %}{% endif %}"><img alt="" class="icon" src="/img/duniter-logo_alt.svg"/> Duniter</a> + {# --- home button --- -#} + <a href="/" class="w3-bar-item w3-button {% if current_path %}{% if current_path == "/" %} active{% endif %}{% endif %}"><img alt="" class="icon" src="/img/duniter-logo_alt.svg"/> Duniter</a> {%- set index = get_section(path="_index.md") -%} {%- set contributeurs = get_section(path="contributeurs/_index.md") -%} + {# --- main links --- -#} {%- for p in index.pages | concat(with=contributeurs) %} {%- if not p.extra.hide -%} <a href="{{ p.permalink }}" class="w3-bar-item w3-button - {%- if current_path %}{% if current_path == p.path %}active{% endif %}{% endif -%} + {%- if current_path %}{% if current_path == p.path %} active{% endif %}{% endif -%} ">{{p.title}}</a> {%- endif -%} {% endfor %} + {# --- langage dropdown --- -#} <div class="w3-dropdown-hover w3-dropdown-click w3-right"> <button class="w3-button" style="font-size: 1.6em; padding: 0 10px;">🇫🇷</button> <div class="w3-dropdown-content w3-bar-block w3-light-grey" style="min-width: 29px;"> @@ -19,6 +22,7 @@ </div> </div> + {# --- useful links --- -#} <div class="w3-dropdown-hover w3-dropdown-click w3-right"> <button class="w3-button">Liens <i class="fa fa-caret-down"></i></button> <div class="w3-dropdown-content w3-bar-block w3-light-grey"> @@ -28,12 +32,13 @@ <a rel="me" href="https://mamot.fr/@duniter" class="w3-bar-item w3-button"><img alt="m" class="icon" src="https://simpleicons.org/icons/mastodon.svg"/> Mastodon</a> </div> </div> - + + {# --- right links --- -#} {%- for s in index.subsections | reverse -%} {%- set subsection = get_section(path=s) -%} {%- if not subsection.extra.hide and subsection.path != contributeurs.path -%} <a href="{{ subsection.permalink }}" class="w3-bar-item w3-button w3-right - {%- if current_path %}{% if current_path is starting_with(subsection.path) %}active{% endif %}{% endif -%} + {%- if current_path %}{% if current_path is starting_with(subsection.path) %} active{% endif %}{% endif -%} ">{{subsection.title}}</a> {%- endif -%} {%- endfor -%}