aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-12-22 12:45:04 +0000
committerAlex <alex@adnab.me>2022-12-22 12:45:04 +0000
commit4831ac27871e44064dc55946c5ae10b8cda32b37 (patch)
treefd886ef1ded44fe457ab12241692d0ac89d52f0e /templates
parent73d4b846ec6976acd0abf53f28144823183fdfbd (diff)
parentec051a85db1ac5c3d05dda1954f9786cc67c0d52 (diff)
downloadguide.deuxfleurs.fr-4831ac27871e44064dc55946c5ae10b8cda32b37.tar.gz
guide.deuxfleurs.fr-4831ac27871e44064dc55946c5ae10b8cda32b37.zip
Merge pull request 'Améliorations du CSS responsive et navigation sur mobile' (#17) from navigation-mobile into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/guide.deuxfleurs.fr/pulls/17
Diffstat (limited to 'templates')
-rw-r--r--templates/_macros.html20
-rw-r--r--templates/_nav.html8
-rw-r--r--templates/index.html24
3 files changed, 31 insertions, 21 deletions
diff --git a/templates/_macros.html b/templates/_macros.html
index 7c301a9..4f8d852 100644
--- a/templates/_macros.html
+++ b/templates/_macros.html
@@ -1,5 +1,7 @@
{% macro render_header() %}
{% set section = get_section(path="_index.md") %}
+
+
<a href="{{ section.permalink }}">
<div class="logo">
<img src="{{ get_url(path=config.extra.juice_logo_path) }}" alt="logo">
@@ -8,14 +10,16 @@
</a>
<nav>
- {% for subpath in section.subsections %}
- {% set sub = get_section(path=subpath) %}
- <a class="nav-item subtitle-text" href="{{ sub.permalink }}">{{ sub.title }}</a>
- {% endfor %}
- {% if config.extra.juice_extra_menu %}
- {% for menu in config.extra.juice_extra_menu %}
- <a class="nav-item subtitle-text" href="{{ menu.link }}">{{ menu.title }}</a>
+ <ul>
+ {% for subpath in section.subsections %}
+ {% set sub = get_section(path=subpath) %}
+ <li><a class="nav-item text" href="{{ sub.permalink }}">{{ sub.title }}</a></li>
{% endfor %}
- {% endif %}
+ {% if config.extra.juice_extra_menu %}
+ {% for menu in config.extra.juice_extra_menu %}
+ <li><a class="nav-item text" href="{{ menu.link }}">{{ menu.title }}</a></li>
+ {% endfor %}
+ {% endif %}
+ </ul>
</nav>
{% endmacro render_header %}
diff --git a/templates/_nav.html b/templates/_nav.html
index 3bfda07..b05e472 100644
--- a/templates/_nav.html
+++ b/templates/_nav.html
@@ -133,9 +133,15 @@
{% set root_path = hierarchy | nth(n=0) %}
{% set root = get_section(path=root_path) %}
+
+ <input id="menu-toggle" type="checkbox" />
+ <label class='menu-button-container' for="menu-toggle">
+ <div class="menu-button"></div>
+ <div class="toc-item toc-menu-title subtext">{{ root.title }}</div>
+ </label>
+
<div class="toc-item toc-section">
<a class="subtext" href="{{root.permalink | safe}}">{{ root.title }}</a>
</div>
-
{{ nav::navsection(hierarchy=hierarchy,level=0,current=current) }}
{% endmacro %}
diff --git a/templates/index.html b/templates/index.html
index 004a4fa..fd4e9bf 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,23 +19,23 @@
<body>
{% block header %}
- <header class="box-shadow">
+ <header class="box-shadow top-nav">
{{ macros::render_header() }}
</header>
{% endblock header %}
<main>
- {% block toc %}
- <div class="toc">
- <div class="toc-sticky">
- {% if page %}
- {{ nav::navmenu(current=page) }}
- {% else %}
- {{ nav::navmenu(current=section) }}
- {% endif %}
- </div>
- </div>
- {% endblock toc %}
+ {% block mainnav %}
+ <div class="toc {% if page.ancestors or section.ancestors %}{% else %}toc-homepage{% endif %}">
+ <div class="toc-sticky">
+ {% if page %}
+ {{ nav::navmenu(current=page) }}
+ {% else %}
+ {{ nav::navmenu(current=section) }}
+ {% endif %}
+ </div>
+ </div>
+ {% endblock mainnav %}
<div class="content text">
{% block content %}