appview: follow web app manifest standard #923

closed
opened by boltless.me targeting master from sl/kuvknkxxvpvu
  • id member in webmanifest should be url format based on spec.
  • it is recommended to use application/mniafest+json mimetype
  • changing the name from pwa-manifest.json to manifest.webmanifest

Reference: https://www.w3.org/TR/appmanifest/

Signed-off-by: Seongmin Lee git@boltless.me

Changed files
+10 -9
appview
+2 -2
appview/pages/templates/layouts/base.html
··· 20 <link rel="preconnect" href="https://avatar.tangled.sh" /> 21 <link rel="preconnect" href="https://camo.tangled.sh" /> 22 23 - <!-- pwa manifest --> 24 - <link rel="manifest" href="/pwa-manifest.json" /> 25 26 <!-- preload main font --> 27 <link rel="preload" href="/static/fonts/InterVariable.woff2" as="font" type="font/woff2" crossorigin />
··· 20 <link rel="preconnect" href="https://avatar.tangled.sh" /> 21 <link rel="preconnect" href="https://camo.tangled.sh" /> 22 23 + <!-- web app manifest --> 24 + <link rel="manifest" href="/manifest.webmanifest" /> 25 26 <!-- preload main font --> 27 <link rel="preload" href="/static/fonts/InterVariable.woff2" as="font" type="font/woff2" crossorigin />
+1 -1
appview/pages/templates/user/completeSignup.html
··· 20 content="complete your signup for tangled" 21 /> 22 <script src="/static/htmx.min.js"></script> 23 - <link rel="manifest" href="/pwa-manifest.json" /> 24 <link 25 rel="stylesheet" 26 href="/static/tw.css?{{ cssContentHash }}"
··· 20 content="complete your signup for tangled" 21 /> 22 <script src="/static/htmx.min.js"></script> 23 + <link rel="manifest" href="/manifest.webmanifest" /> 24 <link 25 rel="stylesheet" 26 href="/static/tw.css?{{ cssContentHash }}"
+1 -1
appview/pages/templates/user/login.html
··· 8 <meta property="og:url" content="https://tangled.org/login" /> 9 <meta property="og:description" content="login to for tangled" /> 10 <script src="/static/htmx.min.js"></script> 11 - <link rel="manifest" href="/pwa-manifest.json" /> 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 13 <title>login &middot; tangled</title> 14 </head>
··· 8 <meta property="og:url" content="https://tangled.org/login" /> 9 <meta property="og:description" content="login to for tangled" /> 10 <script src="/static/htmx.min.js"></script> 11 + <link rel="manifest" href="/manifest.webmanifest" /> 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 13 <title>login &middot; tangled</title> 14 </head>
+1 -1
appview/pages/templates/user/signup.html
··· 8 <meta property="og:url" content="https://tangled.org/signup" /> 9 <meta property="og:description" content="sign up for tangled" /> 10 <script src="/static/htmx.min.js"></script> 11 - <link rel="manifest" href="/pwa-manifest.json" /> 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 13 <title>sign up &middot; tangled</title> 14
··· 8 <meta property="og:url" content="https://tangled.org/signup" /> 9 <meta property="og:description" content="sign up for tangled" /> 10 <script src="/static/htmx.min.js"></script> 11 + <link rel="manifest" href="/manifest.webmanifest" /> 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 13 <title>sign up &middot; tangled</title> 14
+1 -1
appview/state/router.go
··· 34 35 router.Get("/favicon.ico", s.pages.StaticRedirect("/static/favicon.ico")) 36 router.Get("/favicon.svg", s.pages.StaticRedirect("/static/favicon.svg")) 37 - router.Get("/pwa-manifest.json", s.PWAManifest) 38 router.Get("/robots.txt", s.RobotsTxt) 39 40 userRouter := s.UserRouter(&middleware)
··· 34 35 router.Get("/favicon.ico", s.pages.StaticRedirect("/static/favicon.ico")) 36 router.Get("/favicon.svg", s.pages.StaticRedirect("/static/favicon.svg")) 37 + router.Get("/manifest.webmanifest", s.WebAppManifest) 38 router.Get("/robots.txt", s.RobotsTxt) 39 40 userRouter := s.UserRouter(&middleware)
+4 -3
appview/state/state.go
··· 213 } 214 215 // https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest 216 const manifestJson = `{ 217 "name": "tangled", 218 "description": "tightly-knit social coding.", ··· 223 } 224 ], 225 "start_url": "/", 226 - "id": "org.tangled", 227 228 "display": "standalone", 229 "background_color": "#111827", 230 "theme_color": "#111827" 231 }` 232 233 - func (p *State) PWAManifest(w http.ResponseWriter, r *http.Request) { 234 - w.Header().Set("Content-Type", "application/json") 235 w.Write([]byte(manifestJson)) 236 } 237
··· 213 } 214 215 // https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest 216 + // https://www.w3.org/TR/appmanifest/ 217 const manifestJson = `{ 218 "name": "tangled", 219 "description": "tightly-knit social coding.", ··· 224 } 225 ], 226 "start_url": "/", 227 + "id": "https://tangled.org", 228 229 "display": "standalone", 230 "background_color": "#111827", 231 "theme_color": "#111827" 232 }` 233 234 + func (p *State) WebAppManifest(w http.ResponseWriter, r *http.Request) { 235 + w.Header().Set("Content-Type", "application/manifest+json") 236 w.Write([]byte(manifestJson)) 237 } 238