Add default section template
- Prevent "Welcome to Zola!" message if user manually navigates to section page (Navigate to a page then remove last part of url) - Implementation shows the pages in this section if the section content has no words.
This commit is contained in:
parent
3f58467a8a
commit
8e4b42511a
1 changed files with 23 additions and 0 deletions
23
templates/section.html
Normal file
23
templates/section.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% extends "index.html" %}
|
||||
|
||||
{% block title %} {{ config.title }} | {{ section.title }} {% endblock title %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% if section.word_count > 0 %}
|
||||
{{ section.content }}
|
||||
{% else %}
|
||||
<h1 class="title">
|
||||
{{ section.title }}
|
||||
</h1>
|
||||
Pages:
|
||||
<ul>
|
||||
{% for page in section.pages %}
|
||||
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue