feat: Update manifest
All checks were successful
Build Docker / BuildImage (push) Successful in 52s

This commit is contained in:
Nathan Woodburn 2025-01-29 18:41:13 +11:00
parent 622a4038ac
commit d4136a396a
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 35 additions and 7 deletions

26
manifest.json Normal file
View File

@ -0,0 +1,26 @@
{
"short_name": "Nathan.Woodburn/",
"name": "Nathan.Woodburn/",
"icons": [
{
"src": "https://nathan.woodburn.au/assets/img/favicon/android-chrome-192x192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "https://nathan.woodburn.au/assets/img/favicon/android-chrome-512x512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "https://nathan.woodburn.au",
"background_color": "#000000",
"theme_color": "#000000",
"display": "fullscreen",
"orientation": "portrait",
"id": "nathanwoodburn",
"description": "Nathan.Woodburn/",
"scope": "https://nathan.woodburn.au",
"dir": "ltr",
"lang": "en"
}

View File

@ -235,16 +235,18 @@ def xrpLedger():
@app.route("/manifest.json")
def manifest():
host = request.host
if host == "nathan.woodburn.au":
return send_from_directory("templates", "manifest.json")
# Read as json
with open("templates/manifest.json") as file:
with open("manifest.json") as file:
manifest = json.load(file)
if host != "localhost:5000" and host != "127.0.0.1:5000":
manifest["start_url"] = f"https://{host}/"
else:
manifest["start_url"] = "http://127.0.0.1:5000/"
url = f"https://{host}"
if host == "localhost:5000" or host == "127.0.0.1:5000":
url = "http://127.0.0.1:5000"
manifest["start_url"] = url
manifest["scope"] = url
return jsonify(manifest)