From f2055daf1a85e6b51fb4fee5b48312a75197d4e4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 5 Apr 2022 01:14:30 -0400 Subject: [PATCH] Add a /sitemap to the WebHost (#418) --- WebHostLib/__init__.py | 9 ++++++ WebHostLib/templates/check.html | 3 +- WebHostLib/templates/checkResult.html | 3 +- WebHostLib/templates/islandFooter.html | 2 ++ WebHostLib/templates/siteMap.html | 44 ++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 WebHostLib/templates/siteMap.html diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index 2ebfe11c..b13a0961 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -207,6 +207,15 @@ def get_datapackge(): return Response(json.dumps(network_data_package, indent=4), mimetype="text/plain") +@app.route('/sitemap') +def get_sitemap(): + available_games = [] + for game, world in AutoWorldRegister.world_types.items(): + if not world.hidden: + available_games.append(game) + return render_template("siteMap.html", games=available_games) + + from WebHostLib.customserver import run_server_process from . import tracker, upload, landing, check, generate, downloads, api # to trigger app routing picking up on it diff --git a/WebHostLib/templates/check.html b/WebHostLib/templates/check.html index d21f487f..64f19b0f 100644 --- a/WebHostLib/templates/check.html +++ b/WebHostLib/templates/check.html @@ -8,7 +8,7 @@ {% endblock %} {% block body %} - {% include 'header/oceanHeader.html' %} + {% include 'header/oceanIslandHeader.html' %}

Upload Yaml

@@ -24,5 +24,4 @@
- {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/checkResult.html b/WebHostLib/templates/checkResult.html index 23dcd2a8..45a21ae7 100644 --- a/WebHostLib/templates/checkResult.html +++ b/WebHostLib/templates/checkResult.html @@ -7,7 +7,7 @@ {% endblock %} {% block body %} - {% include 'header/oceanHeader.html' %} + {% include 'header/oceanIslandHeader.html' %}

Verification Results

@@ -30,5 +30,4 @@
- {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/islandFooter.html b/WebHostLib/templates/islandFooter.html index 629ae146..66995f01 100644 --- a/WebHostLib/templates/islandFooter.html +++ b/WebHostLib/templates/islandFooter.html @@ -2,6 +2,8 @@