Schování navigace pokud neexistují stránky

master
Emil Miler 5 years ago
parent 1408506800
commit 9af4e764a1

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

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

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

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