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

@@ -44,36 +44,12 @@ def funcGen(pagename, pages):
for i in pages: for i in pages:
func = funcGen(i, pages) func = funcGen(i, pages)
app.add_url_rule(pages[i]['canonical'], i, func) 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")
@app.route("/Resume.pdf") @app.route("/Resume.pdf")
def resume(): def resume():
return flask.send_file("./static/Resume.pdf") 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) @app.errorhandler(Exception)
def page404(e): def page404(e):
eCode = e.code eCode = e.code

View File

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

View File

@@ -14,7 +14,7 @@
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta <meta
property="og:image" 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="og:url" content="{{ var['description'] }}" />
<meta property="twitter:title" content="Andrew Simonson" /> <meta property="twitter:title" content="Andrew Simonson" />
@@ -23,7 +23,7 @@
<meta property="og:site_name" content="Andrew Simonson - Portfolio" /> <meta property="og:site_name" content="Andrew Simonson - Portfolio" />
<meta <meta
property="twitter:image" 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:image:alt" content="some example picture idk" />
<meta name="twitter:site" content="@asimonson1125" /> <meta name="twitter:site" content="@asimonson1125" />
@@ -56,7 +56,7 @@
href="{{ url_for('static', filename='css/head.css') }}" 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/checkbox.js') }}"></script>
<script src="{{ url_for('static', filename='js/responsive.js') }}"></script> <script src="{{ url_for('static', filename='js/responsive.js') }}"></script>
<script src="{{ url_for('static', filename='js/chessbed.js') }}"></script> <script src="{{ url_for('static', filename='js/chessbed.js') }}"></script>
@@ -65,7 +65,8 @@
{% block header %} {% block header %}
<body onpopstate="backButton()"> <body onpopstate="backButton()">
<noscript>You need to enable JavaScript to run this app.</noscript> <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 id="contentStuffer">
<div class="header"> <div class="header">
<div id="name-container" onclick="goto('home')"> <div id="name-container" onclick="goto('home')">