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:
Che 2022-05-29 05:02:38 -04:00
parent 3f58467a8a
commit 8e4b42511a

23
templates/section.html Normal file
View 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 %}