Schování navigace pokud neexistují stránky

master
Emil Miler 5 years ago
parent 1408506800
commit 9af4e764a1

@ -55,7 +55,6 @@ body {
#nav {
float: left;
height: 100%;
border-right: 1px dotted #ccc;
padding: 1em 0;
width: 200px;

@ -12,7 +12,7 @@
<div id="header">
{% set current_section = get_section(path="_index.md") %}
<a href="{{ config.base_url }}">{{ config.title }}</a>
<span class="subtitle">{% block subtitle %}{{ config.description }}{% endblock %}</span>
<span class="subtitle">&ndash; {% block subtitle %}{{ config.description }}{% endblock %}</span>
</div>
<div id="menu">
<ul>
@ -27,17 +27,17 @@
</ul>
</div>
<div id="content">
<div id="nav">
{% block nav %}
{% if section.pages %}
{% block nav %}
{% if section.pages %}
<div id="nav">
<ul>
{% for post in section.pages %}
<li><a href="{{ post.permalink }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
</div>
</div>
{% endif %}
{% endblock %}
<div id="main">
{% block content%}{% endblock %}
</div>

@ -5,12 +5,6 @@
{{ current_section.title }}
{% endblock %}
{% block content %}
<h1>{{ page.title }}</h1>
{{ page.content | safe }}
{% endblock %}
{% block menu %}
{% set global_section = get_section(path="_index.md") %}
{% for s in global_section.subsections %}
@ -23,10 +17,18 @@
{% block nav %}
{% if current_section.pages %}
<ul>
{% for post in current_section.pages %}
<li><a href="{{ post.permalink }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
<div id="nav">
<ul>
{% for post in current_section.pages %}
<li><a href="{{ post.permalink }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}
{% block content %}
<h1>{{ page.title }}</h1>
{{ page.content | safe }}
{% endblock %}

@ -11,4 +11,5 @@
{% block content %}
<h1>{{ section.title }}</h1>
{{ section.content | safe }}
{{ __tera_context }}
{% endblock content %}