Reorganize sidebar menu so that child pages are listed under the current page, instead of in a whole other menu.
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
2024-10-02 19:29:06 -05:00
parent a93412facf
commit 91ea5fbfce
2 changed files with 18 additions and 7 deletions

3
templates/base.css Normal file
View File

@@ -0,0 +1,3 @@
#sidebar .highlight ul {
margin-left: 20px;
}

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>{{ page.name }}</title>
<title>{{ page.title }}</title>
<meta name="Author" content="John Zaitseff, J.Zaitseff@zap.org.au" />
<meta name="Description" content="A minimal template page to use with the Sinorcaish CSS stylesheet" />
<meta name="Copyright" content="This file may be redistributed and/or modified without limitation" />
@@ -13,6 +13,7 @@
<link rev="made" href="mailto:J.Zaitseff@zap.org.au" />
{% block styles %}
<link rel="StyleSheet" href="{{ relative_root | safe }}sinorcaish-screen.css" type="text/css" media="screen" />
<link rel="StyleSheet" href="{{ relative_root | safe }}base.css" type="text/css" media="screen" />
<link rel="StyleSheet" href="{{ relative_root | safe }}sinorcaish-print.css" type="text/css" media="print" />
{% endblock styles %}
</head>
@@ -81,18 +82,25 @@
<p class="title"><a href="{{ relative_root | safe }}{{ page.parent.url }}">{{ page.parent.name }}</a></p>
<ul>
{% for child in page.parent.children %}
<li{% if child == page.name %} class="highlight"{% endif %}><a href="{% if page.is_directory %}../{% endif %}{{ child }}">{{ child }}</a></li>
<li{% if child == page.name %} class="highlight"{% endif %}>
<a href="{% if page.is_directory %}../{% endif %}{{ child }}">{{ child | file_stem }}</a>
{% if page.is_directory and child == page.name %}
<ul>
{% for child in page.children %}
<li><a href="{{ child }}">{{ child | file_stem }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if page.is_directory %}
{% else %}
<div>
<p class="title"><a href="{{ relative_root | safe }}{{ page.url }}">{{ page.name }}</a></p>
<ul>
{% for child in page.children %}
<li><a href="{{ child }}">{{ child }}</a></li>
<li><a href="{{ child }}">{{ child | file_stem }}</a></li>
{% endfor %}
</ul>
</div>
@@ -110,7 +118,7 @@
{% for ancestor in ancestors %}
<a href="{{ relative_root | safe }}{{ ancestor.url }}">{% if ancestor.name %} {{ ancestor.name }} {% else %} Home {% endif %}</a> &raquo;
{% endfor %}
<a href="{{ relative_root | safe }}{{ page.url }}">{% if page.name %} {{ page.name }} {% else %} Home {% endif %}</a>
<a href="{{ relative_root | safe }}{{ page.url }}">{% if page.name %} {{ page.title }} {% else %} Home {% endif %}</a>
</div>
{% block content %}