Commit 166e1bc9 authored by Markus Willman's avatar Markus Willman

implement better responsive menu + header element order

parent 536e1238
......@@ -66,6 +66,9 @@ blockquote.blockquote {
width: 50px;
height: 50px;
font: inherit;
font-size: 1.2rem;
background-image: url("../img/logo/dcnf-small.png");
background-size: 50px 50px;
background-repeat: no-repeat;
......
......@@ -89,25 +89,36 @@
{% block header -%}
{% set site_menu = load_json(menu_file) | default([{'link': '/', 'text': 'Home'}]) -%}
{% if not hide_menu and not (site_menu is empty) %}
<nav>
<ul class="nav nav-pills flex-column flex-sm-row float-sm-right d-print-none">
{{ util.build_menu(site_menu, page_subtitle) }}
</ul>
</nav>
{% endif -%}
<h4>
<a class="link-unstyled" href="{{ make_url('/') }}">
<span class="logo-s50">&nbsp;</span><span class="text-hide">DCNF</span> <small class="{% if not hide_menu %}d-sm-none d-lg-inline {% endif %}d-print-inline tagline">{{ content_owner }}</small>
</a>
{% if hide_menu or (site_menu is empty) -%}
<a class="back-link float-right btn btn-primary d-print-none" href="{{ make_url(base_url) }}" role="button"><i class="fas fa-chevron-left fa-lg" aria-hidden="true"></i> Go Back</a>
{% endif -%}
{% if git_info -%}
<div class="d-sm-inline-block d-print-block mb-2">
<h4 class="d-inline">
<a class="link-unstyled" href="{{ make_url('/') }}">
<span class="text-hide logo-s50">DCNF</span>&nbsp;<small class="{% if not hide_menu %}d-sm-none d-lg-inline {% endif %}d-print-inline tagline">{{ content_owner }}</small>
</a>
</h4>
{% if git_info %}
<span class="d-none d-print-inline h6 print-pubdate float-right">{{ git_info.date | date('Y-m-d') }}</span>
{% endif -%}
</h4>
{%- endif %}
{% if not hide_menu and not (site_menu is empty) -%}
<button class="d-block d-sm-none d-print-none float-right btn btn-sm btn-outline-secondary"
type="button" data-toggle="collapse" data-target="#collapseMenu" aria-expanded="false" aria-controls="collapseMenu">
<i class="fas fa-bars" aria-hidden="true"></i> <span class="sr-only">Menu</span>
</button>
{%- endif %}
</div>
<nav class="d-block d-sm-inline float-sm-right d-print-none">
{% if not hide_menu and not (site_menu is empty) -%}
<div class="collapse d-sm-block" id="collapseMenu">
<ul class="nav nav-pills mb-3 flex-column flex-sm-row">
{{ util.build_menu(site_menu, page_subtitle) }}
</ul>
</div>
{%- else -%}
<a class="back-link mb-2 float-right btn btn-primary" href="{{ make_url(base_url) }}" role="button"><i class="fas fa-chevron-left fa-lg" aria-hidden="true"></i> Go Back</a>
{%- endif %}
</nav>
{%- endblock %}
</header>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment