Skip to content

Commit

Permalink
Add a simple manifest file to hopefully work as 'progressive web app'
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Feb 10, 2019
1 parent d729dc5 commit 30d4945
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stuff/image-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
15 changes: 15 additions & 0 deletions stuff/static/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions stuff/template/form-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>{{.PageTitle}}</title>
<link rel="icon" type="image/png" href="/static/stuff-icon.png">
<link rel="manifest" href="/static/manifest.json">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/static/stuff.css"/>
<style>
Expand Down
1 change: 1 addition & 0 deletions stuff/template/search-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<title>Noisebridge Parts search</title>
<link rel="icon" type="image/png" href="/static/stuff-icon.png">
<link rel="manifest" href="/static/manifest.json">
<link rel="stylesheet" type="text/css" href="/static/stuff.css"/>
<meta name="viewport" content="width=device-width">
<style>
Expand Down

0 comments on commit 30d4945

Please sign in to comment.