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!