Monorepo for Tangled tangled.org

appview: follow web app manifest standard

- `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>

boltless.me a27c8a5a b41e8f03

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