Skip to content

Commit 047836f

Browse files
committed
added sitemap
1 parent 34bb6f6 commit 047836f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

app.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, render_template, request, redirect, url_for, session, flash
1+
from flask import Flask, render_template, request, redirect, url_for, session, flash, Response
22
from routes.index_routes import index_blueprint
33
from routes.browse_routes import browse_blueprint
44
from routes.login_routes import login_blueprint
@@ -18,7 +18,14 @@
1818
def page_not_found(error):
1919
return render_template('components/error.html',theme_css=theme_selection()), 404
2020

21-
21+
@app.route('/sitemap.xml')
22+
def sitemap():
23+
try:
24+
with open('sitemap.xml', 'r') as f:
25+
sitemap_content = f.read()
26+
return Response(sitemap_content, content_type='application/xml')
27+
except FileNotFoundError:
28+
return "Sitemap not found", 404
2229

2330
if __name__ == '__main__':
2431
app.run()

sitemap.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
2+
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
3+
<url>
4+
<loc>https://codecolts.vercel.app/</loc>
5+
<lastmod>2024-01-26T15:33:01+00:00</lastmod>
6+
<priority>1.00</priority>
7+
</url>
8+
<url>
9+
<loc>https://codecolts.vercel.app/browse</loc>
10+
<lastmod>2024-01-26T15:33:01+00:00</lastmod>
11+
<priority>0.80</priority>
12+
</url>
13+
<url>
14+
<loc>https://codecolts.vercel.app/login</loc>
15+
<lastmod>2024-01-26T15:33:01+00:00</lastmod>
16+
<priority>0.80</priority>
17+
</url>
18+
</urlset>

0 commit comments

Comments
 (0)