feat: Add manifest.json to allow installing pwa
All checks were successful
Build Docker / BuildImage (push) Successful in 58s

This commit is contained in:
Nathan Woodburn 2024-09-17 15:38:58 +10:00
parent c3184c3104
commit 66aa987013
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
4 changed files with 24 additions and 2 deletions

View File

@ -101,8 +101,6 @@ def send_report(path):
): ):
if os.path.isfile("templates/assets/img/" + filename): if os.path.isfile("templates/assets/img/" + filename):
return send_from_directory("templates/assets/img", filename) return send_from_directory("templates/assets/img", filename)
if os.path.isfile("templates/assets/img/favicon/" + filename):
return send_from_directory("templates/assets/img/favicon", filename)
return render_template("404.html"), 404 return render_template("404.html"), 404
@ -870,6 +868,14 @@ def index():
) )
@app.route("/manifest.json")
def manifest():
with open("templates/manifest.json", "r") as file:
manifest = json.load(file)
manifest["start_url"] = request.url_root
return jsonify(manifest)
@app.route("/<path:path>") @app.route("/<path:path>")
def catch_all(path: str): def catch_all(path: str):
if os.path.isfile("templates/" + path): if os.path.isfile("templates/" + path):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -34,6 +34,7 @@
<link rel="stylesheet" href="assets/css/Navbar-Right-Links-Dark-icons.css"> <link rel="stylesheet" href="assets/css/Navbar-Right-Links-Dark-icons.css">
<link rel="stylesheet" href="assets/css/Team-images.css"> <link rel="stylesheet" href="assets/css/Team-images.css">
<link rel="stylesheet" href="assets/css/index.css"> <link rel="stylesheet" href="assets/css/index.css">
<link rel="manifest" href="manifest.json">
<script async src="https://umami.woodburn.au/script.js" <script async src="https://umami.woodburn.au/script.js"
data-website-id="7e0ed7e4-3858-4124-a574-b57ac05aaad1"></script> data-website-id="7e0ed7e4-3858-4124-a574-b57ac05aaad1"></script>

15
templates/manifest.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "HNSDoH Status",
"short_name": "HNSDoH Status",
"start_url": "https://{{host}}/",
"display": "standalone",
"background_color": "#212529",
"theme_color": "#212529",
"orientation": "portrait-primary",
"icons": [
{
"src": "/favicon.png",
"sizes": "500x500"
}
]
}