Fix toc again

This commit is contained in:
Bottersnike 2023-05-30 00:46:24 +01:00
parent eb83f82151
commit 630f9226ff
Signed by: Bottersnike
SSH Key Fingerprint: SHA256:3g0ghwd4dNX1k1RX8qazbiT+3RIYn/daeBevHZVCiU0
2 changed files with 6 additions and 1 deletions

View File

@ -135,6 +135,11 @@ def generate_toc(base, name, route, start=1):
parts = route.strip("/").split("/")
toc = CONTENTS
for i in PAGES_BASE.split("/")[1:]:
toc = toc[i]
if parts == [""]:
parts = []
for i in parts:
if i in toc:
toc = toc[i]

View File

@ -4,7 +4,7 @@
<table class="nav">
<tr>
<td><a href="{{ROOT}}/">Contents</a></td>
<td><a href="{{ROOT}}/intro/">Intro</a></td>
<td><a href="{{ROOT}}/intro">Intro</a></td>
<td><a href="{{ROOT}}/software/">Software</a></td>
<td><a href="{{ROOT}}/hardware/">Hardware</a></td>
<td><a href="{{ROOT}}/manual/">Manual</a></td>