diff --git a/server.py b/server.py index 7cbb0ba..5bcbb69 100644 --- a/server.py +++ b/server.py @@ -5,24 +5,56 @@ import dotenv app = Flask(__name__) dotenv.load_dotenv() +#Assets routes @app.route('/assets/') def send_report(path): return send_from_directory('templates/assets', path) +# Special routes +@app.route('/links') +def links(): + return render_template('link.html') + +@app.route('/sitemap') +@app.route('/sitemap.xml') +def sitemap(): + # Remove all .html from sitemap + with open('templates/sitemap.xml') as file: + sitemap = file.read() + + sitemap = sitemap.replace('.html', '') + return make_response(sitemap, 200, {'Content-Type': 'application/xml'}) + +@app.route('/favicon.png') +def faviconPNG(): + return send_from_directory('templates/assets/img', 'android-chrome-512x512.png') + +@app.route('/favicon.ico') +def favicon(): + return send_from_directory('templates/assets/img', 'favicon.ico') + +@app.route('/favicon.svg') +def faviconSVG(): + return send_from_directory('templates/assets/img', 'favicon.svg') + + +# Main routes + @app.route('/') def index(): handshake_scripts = "" # If localhost, don't load handshake - if request.host == "localhost:5000" or request.host == "127.0.0.1:5000": + if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true": handshake_scripts = "" return render_template('index.html', handshake_scripts=handshake_scripts) + @app.route('/') def catch_all(path): handshake_scripts = "" # If localhost, don't load handshake - if request.host == "localhost:5000" or request.host == "127.0.0.1:5000": + if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true": handshake_scripts = "" # If file exists, load it if os.path.isfile('templates/' + path): diff --git a/templates/assets/img/favicon.ico b/templates/assets/img/favicon.ico new file mode 100644 index 0000000..9045050 Binary files /dev/null and b/templates/assets/img/favicon.ico differ diff --git a/templates/info.html b/templates/info.html deleted file mode 100644 index 9bb8e32..0000000 --- a/templates/info.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - Nathan.Woodburn/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-

Docker Status

-

Docker status

-

Uptime

-

0:00

-

0% RAM Used

-

0% CPU Used

-

0% Disk Used

-
-
- - - - - - \ No newline at end of file diff --git a/templates/projects.html b/templates/projects.html index b7946ed..f401c4f 100644 --- a/templates/projects.html +++ b/templates/projects.html @@ -70,7 +70,7 @@ height="0" width="0" style="display:none;visibility:hidden">
-

Check out my Github for all my projects

+

Check out my Git for all my projects

diff --git a/templates/sitemap.xml b/templates/sitemap.xml index 7146aed..6e0cb1d 100644 --- a/templates/sitemap.xml +++ b/templates/sitemap.xml @@ -12,9 +12,6 @@ https://nathan.woodburn.au/ - - https://nathan.woodburn.au/info.html - https://nathan.woodburn.au/link.html