diff options
author | Alex <alex@adnab.me> | 2022-06-01 17:04:10 +0200 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-06-01 17:04:10 +0200 |
commit | e69ee6ab7c0519d6897133d6269be16a307cf175 (patch) | |
tree | deb249595896219cefdd11a641de8cb651cabe7d /templates/index.html | |
parent | 40596285a182ddd469422de25f7c78bcef098953 (diff) | |
parent | 71980e93aecc7137017f769f8de746d9b2959b9d (diff) | |
download | guide.deuxfleurs.fr-e69ee6ab7c0519d6897133d6269be16a307cf175.tar.gz guide.deuxfleurs.fr-e69ee6ab7c0519d6897133d6269be16a307cf175.zip |
Merge pull request 'Hierarchical navigation menu' (#4) from hier-nav-menu into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/man.deuxfleurs.fr/pulls/4
Diffstat (limited to 'templates/index.html')
-rw-r--r-- | templates/index.html | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/templates/index.html b/templates/index.html index 54fb473..004a4fa 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,4 +1,5 @@ {% import "_macros.html" as macros %} +{% import "_nav.html" as nav %} <!DOCTYPE html> <html lang="en"> @@ -7,7 +8,7 @@ <title>{% block title %}{{ config.title }}{% endblock title %}</title> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> {% block favicon %} - <link rel="icon" type="image/png" href="/favicon.ico"> + <link rel="icon" type="image/png" href="/favicon.ico"> {% endblock favicon %} {% include "_variables.html" %} <link rel="stylesheet" href="/normalize.css"> @@ -24,46 +25,21 @@ {% endblock header %} <main> - {% block toc %} - {% if page.ancestors %} - {% set section = get_section(path=page.ancestors | last) %} - {% endif %} - {% if section.ancestors %} - {% set parent = get_section(path=section.ancestors | last) %} - {% endif %} + {% block toc %} <div class="toc"> - <div class="toc-sticky"> - <div class="toc-item toc-section"> - <a class="subtext" href="{{section.permalink | safe}}">{{ section.title }}</a> - </div> - {% if section.subsections %} - {% for s in section.subsections %} - {% set p = get_section(path=s) %} - <div class="toc-item"> - <a class="subtext" href="{{ p.permalink | safe}}">{{ p.title }}</a> - </div> - {% endfor %} - {% endif %} - - {% if section.pages %} - {% for p in section.pages %} - <div class="toc-item"> - <a class="subtext" href="{{p.permalink | safe}}">{{ p.title }}</a> - </div> - {% endfor %} - {% endif %} - {% if parent %} - <div class="toc-item"> - <a class="subtext" href="{{parent.permalink | safe}}">← Retour</a> - </div> - {% endif %} - </div> + <div class="toc-sticky"> + {% if page %} + {{ nav::navmenu(current=page) }} + {% else %} + {{ nav::navmenu(current=section) }} + {% endif %} + </div> </div> - {% endblock toc %} + {% endblock toc %} <div class="content text"> {% block content %} - <div id="features" class="heading-text">{{ section.title }} </div> + <div id="features" class="heading-text">{{ section.title }} </div> {{ section.content | safe }} {% endblock content %} </div> @@ -75,10 +51,10 @@ {% block footer %} <footer> <small class="subtext"> - Édité et hébergé par <a href="https://deuxfleurs.fr">Deuxfleurs</a>, - généré par <a href="https://www.getzola.org">Zola</a>, - thème dérivé de <a href="https://github.com/huhu/juice">Juice</a>, - servi par <a href="https://garagehq.deuxfleurs.fr/">Garage</a>. + Édité et hébergé par <a href="https://deuxfleurs.fr">Deuxfleurs</a>, + généré par <a href="https://www.getzola.org">Zola</a>, + thème dérivé de <a href="https://github.com/huhu/juice">Juice</a>, + servi par <a href="https://garagehq.deuxfleurs.fr/">Garage</a>. </small> </footer> {% endblock footer %} |