aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-22 00:07:05 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-22 00:07:05 +0100
commit719c8cf49309890ad82ef0cf9b87aeed299b6777 (patch)
tree3f5789685f5818e9c9f15baa1f480e97e23e4df3 /templates
parent73d4b846ec6976acd0abf53f28144823183fdfbd (diff)
downloadguide.deuxfleurs.fr-719c8cf49309890ad82ef0cf9b87aeed299b6777.tar.gz
guide.deuxfleurs.fr-719c8cf49309890ad82ef0cf9b87aeed299b6777.zip
Tentative 1 for Mobile navigation menu
Diffstat (limited to 'templates')
-rw-r--r--templates/_macros.html20
-rw-r--r--templates/index.html28
2 files changed, 29 insertions, 19 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/index.html b/templates/index.html
index 004a4fa..a00a979 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,23 +19,29 @@
<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) }}
+ {% block mainnav %}
+ {% if page.ancestors or section.ancestors %}
+ <input id="menu-toggle" type="checkbox" {% if section.subsections or section.pages %}checked{% endif %} />
+ <label class='menu-button-container' for="menu-toggle">
+ <div class='menu-button'></div>
+ </label>
+ <div class="toc" id="navigation">
+ <div class="toc-sticky">
+ {% if page %}
+ {{ nav::navmenu(current=page) }}
+ {% else %}
+ {{ nav::navmenu(current=section) }}
+ {% endif %}
+ </div>
+ </div>
{% endif %}
- </div>
- </div>
- {% endblock toc %}
+ {% endblock mainnav %}
<div class="content text">
{% block content %}