From 30d49450ecc560794eba9539ff1e7badc71b3e89 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sun, 10 Feb 2019 04:11:48 +0100 Subject: [PATCH] Add a simple manifest file to hopefully work as 'progressive web app' --- stuff/image-handler.go | 2 ++ stuff/static/manifest.json | 15 +++++++++++++++ stuff/template/form-template.html | 1 + stuff/template/search-result.html | 1 + 4 files changed, 19 insertions(+) create mode 100644 stuff/static/manifest.json diff --git a/stuff/image-handler.go b/stuff/image-handler.go index 778320c..99fccb8 100644 --- a/stuff/image-handler.go +++ b/stuff/image-handler.go @@ -155,6 +155,8 @@ func sendResource(local_path string, fallback_resource string, out http.Response out.Header().Set("Content-Type", "image/svg+xml;charset=utf-8") case strings.HasSuffix(local_path, ".txt"): out.Header().Set("Content-Type", "text/plain") + case strings.HasSuffix(local_path, ".json"): + out.Header().Set("Content-Type", "application/json") default: out.Header().Set("Content-Type", "image/jpg") } diff --git a/stuff/static/manifest.json b/stuff/static/manifest.json new file mode 100644 index 0000000..2fd34a6 --- /dev/null +++ b/stuff/static/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Parts", + "name": "Parts and Stuff", + "icons": [ + { + "src": "/static/stuff-icon.png", + "type": "image/png", + "sizes": "32x32" + } + ], + "start_url": "/search", + "background_color": "#FFFFFF", + "display": "standalone", + "theme_color": "#FFFFFF" +} diff --git a/stuff/template/form-template.html b/stuff/template/form-template.html index 8f4d5cf..3b286eb 100644 --- a/stuff/template/form-template.html +++ b/stuff/template/form-template.html @@ -3,6 +3,7 @@ {{.PageTitle}} +