Fix routing

This commit is contained in:
Bottersnike 2023-05-30 00:38:04 +01:00
parent 695cf61936
commit 24367d3a8c
Signed by: Bottersnike
SSH Key Fingerprint: SHA256:3g0ghwd4dNX1k1RX8qazbiT+3RIYn/daeBevHZVCiU0
2 changed files with 8 additions and 6 deletions

View File

@ -224,7 +224,7 @@ def generate_footer(base, name, route):
break
if toc == CONTENTS and len(parts) == 1:
toc = toc[""]
toc = toc[PAGES_BASE.partition("/")[2]]
if toc is None:
siblings = None
@ -351,6 +351,8 @@ for base, _, files in os.walk(TEMPLATES + "/" + PAGES_BASE):
if not route.startswith("/"):
route = "/" + route
print([route, base, name])
handler = handler(base, name, route)
handler.__name__ == route
app.add_url_rule(route, route, handler)

View File

@ -3,11 +3,11 @@
{% block rootbody %}
<table class="nav">
<tr>
<td><a href="{{ROOT}}/sega/">Contents</a></td>
<td><a href="{{ROOT}}/sega/intro/">Intro</a></td>
<td><a href="{{ROOT}}/sega/software/">Software</a></td>
<td><a href="{{ROOT}}/sega/hardware/">Hardware</a></td>
<td><a href="{{ROOT}}/sega/manual/">Manual</a></td>
<td><a href="{{ROOT}}/">Contents</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>
</tr>
</table>
{% block body %}{% endblock %}