freaky hotspots

This commit is contained in:
2024-10-13 20:17:10 -04:00
parent 13c1eac9b7
commit 45e1967b74
3 changed files with 5 additions and 30 deletions

View File

@@ -45,35 +45,11 @@ for i in pages:
func = funcGen(i, pages)
app.add_url_rule(pages[i]['canonical'], i, func)
# for i in pages:
# exec(f"@app.route(pages['{i}']['canonical'])\ndef {i}(): return flask.render_template('header.html', var=pages['{i}'])")
@app.route("/resume")
@app.route("/Resume.pdf")
def resume():
return flask.send_file("./static/Resume.pdf")
@app.route("/hotspots")
def hotspotsRIT():
url = HotspotsURL
if flask.request.args.get("legend") == "false":
url += "?legend=false"
pagevars = {
"template": "iframe.html",
"title": f"Hotspots @ RIT",
"description": "Hotspots @ RIT by Andrew Simonson",
"canonical": "/hotspots",
}
return flask.render_template("iframe.html", url=url, var=pagevars)
@app.route("/hotspots/<path>")
def hotspotsProxy(path):
resp = flask.make_response(requests.get(f"{HotspotsURL}/{path}").content)
resp.headers['Access-Control-Allow-Origin'] = '*' # or restrict to your site's domain
return resp
@app.errorhandler(Exception)
def page404(e):
eCode = e.code

View File

@@ -4,5 +4,3 @@ try:
__import__('envs.py')
except ImportError:
pass
HotspotsURL = env.get('HotspotsURL', 'https://asimonson.com/hotspots')

View File

@@ -14,7 +14,7 @@
<meta property="og:type" content="website" />
<meta
property="og:image"
content="https://asimonson.com{{ url_for('static', filename='icons/rasterLogoCircle.png') }}"
content="{{ url_for('static', filename='icons/rasterLogoCircle.png') }}"
/>
<meta property="og:url" content="{{ var['description'] }}" />
<meta property="twitter:title" content="Andrew Simonson" />
@@ -23,7 +23,7 @@
<meta property="og:site_name" content="Andrew Simonson - Portfolio" />
<meta
property="twitter:image"
content="https://asimonson.com{{ url_for('static', filename='icons/rasterLogoCircle.png') }}"
content="{{ url_for('static', filename='icons/rasterLogoCircle.png') }}"
/>
<meta name="twitter:image:alt" content="some example picture idk" />
<meta name="twitter:site" content="@asimonson1125" />
@@ -56,7 +56,7 @@
href="{{ url_for('static', filename='css/head.css') }}"
/></!-->
<link rel="canonical" href="https://asimonson.com{{ var['canonical'] }}" />
<link rel="canonical" href="{{ var['canonical'] }}" />
<script src="{{ url_for('static', filename='js/checkbox.js') }}"></script>
<script src="{{ url_for('static', filename='js/responsive.js') }}"></script>
<script src="{{ url_for('static', filename='js/chessbed.js') }}"></script>
@@ -65,7 +65,8 @@
{% block header %}
<body onpopstate="backButton()">
<noscript>You need to enable JavaScript to run this app.</noscript>
<iframe src="/hotspots?legend=false" title="HotspotsRIT" id="map"></iframe>
<!-- TO REPLACE WITH hotspots.asimonson.com -->
<iframe src="https://asimonson.com/hotspots?legend=false" title="HotspotsRIT" id="map"></iframe>
<div id="contentStuffer">
<div class="header">
<div id="name-container" onclick="goto('home')">