From 1f9b38306cb4a84aecc690b76ca1f3285ae8173b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 19 Jun 2024 13:12:33 +1000 Subject: [PATCH] fix: Index page --- cleanSite.py | 29 +++++++++++++++++++++++++++++ templates/index.html | 5 +---- templates/projects.html | 5 +---- templates/servers.html | 5 +---- 4 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 cleanSite.py diff --git a/cleanSite.py b/cleanSite.py new file mode 100644 index 0000000..e33a6ff --- /dev/null +++ b/cleanSite.py @@ -0,0 +1,29 @@ +import os + +# Read all files in the templates directory +for file in os.listdir('templates'): + # Check if the file is sitemap.xml + if file == 'sitemap.xml': + # Open the file + with open('templates/sitemap.xml', 'r') as f: + # Read the content + content = f.read() + # Replace all .html with empty string + content = content.replace('.html', '') + # Write the content back to the file + with open('templates/sitemap.xml', 'w') as f: + f.write(content) + # Skip the file + continue + + # If the file is not an html file, skip it + if not file.endswith('.html'): + continue + + # Open the file + with open('templates/' + file, 'r') as f: + # Read and remove all .html + content = f.read().replace('.html"', '"') + # Write the cleaned content back to the file + with open('templates/' + file, 'w') as f: + f.write(content) \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 28d2eeb..797bc2a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -101,15 +101,12 @@ Check them out here!
{% for project in projects %} -
+

{{ project.name }}

{{ project.description }}

- {% if project.actions %} - Build Status - {% endif %}
diff --git a/templates/projects.html b/templates/projects.html index b605fda..ceb095c 100644 --- a/templates/projects.html +++ b/templates/projects.html @@ -36,10 +36,7 @@ - - - +