Monorepo for Tangled tangled.org

Add Firefox for Android PWA support #634

closed opened by vielle.dev targeting master from vielle.dev/core: pwa

the images could be generated from the dolly svg but that would probably require bringing in a large dependency like inkscape and wouldn't bring huge benifits imo (&& just sticking it in tree was mentioned as best in the discord)

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:4zht3z4caxwrw3dlsybodywc/sh.tangled.repo.pull/3m2ce6i4y4r22
+64
Diff #0
+3
appview/pages/templates/layouts/base.html
··· 14 14 <link rel="preconnect" href="https://avatar.tangled.sh" /> 15 15 <link rel="preconnect" href="https://camo.tangled.sh" /> 16 16 17 + <!-- pwa manifest --> 18 + <link rel="manifest" href="/pwa-manifest.json" /> 19 + 17 20 <!-- preload main font --> 18 21 <link rel="preload" href="/static/fonts/InterVariable.woff2" as="font" type="font/woff2" crossorigin /> 19 22
+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 24 <link 24 25 rel="stylesheet" 25 26 href="/static/tw.css?{{ cssContentHash }}"
+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 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 12 13 <title>login &middot; tangled</title> 13 14 </head>
+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 12 <link rel="stylesheet" href="/static/tw.css?{{ cssContentHash }}" type="text/css" /> 12 13 <title>sign up &middot; tangled</title> 13 14
+1
appview/state/router.go
··· 37 37 router.Use(middleware.TryRefreshSession()) 38 38 router.Get("/favicon.svg", s.Favicon) 39 39 router.Get("/favicon.ico", s.Favicon) 40 + router.Get("/pwa-manifest.json", s.PWAManifest) 40 41 41 42 userRouter := s.UserRouter(&middleware) 42 43 standardRouter := s.StandardRouter(&middleware)
+55
appview/state/state.go
··· 198 198 s.pages.Favicon(w) 199 199 } 200 200 201 + // https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest 202 + const manifestJson = `{ 203 + "name": "tangled", 204 + "description": "tightly-knit social coding.", 205 + "icons": [ 206 + { 207 + "src": "/favicon.svg", 208 + "type": "image/xml+svg", 209 + "sizes": "any", 210 + "purpose": "any" 211 + }, 212 + { 213 + "src": "/static/pwa-512.png", 214 + "type": "image/png", 215 + "sizes": "512x512" 216 + }, 217 + { 218 + "src": "/static/pwa-192.png", 219 + "type": "image/png", 220 + "sizes": "192x192" 221 + }, 222 + { 223 + "src": "/static/pwa-144.png", 224 + "type": "image/png", 225 + "sizes": "144x144" 226 + }, 227 + { 228 + "src": "/static/pwa-96.png", 229 + "type": "image/png", 230 + "sizes": "96x96" 231 + }, 232 + { 233 + "src": "/static/pwa-72.png", 234 + "type": "image/png", 235 + "sizes": "72x72" 236 + }, 237 + { 238 + "src": "/static/pwa-48.png", 239 + "type": "image/png", 240 + "sizes": "48x48" 241 + } 242 + ], 243 + "start_url": "/", 244 + "id": "org.tangled", 245 + 246 + "display": "standalone", 247 + "background_color": "#111827", 248 + "theme_color": "#111827" 249 + }` 250 + 251 + func (p *State) PWAManifest(w http.ResponseWriter, r *http.Request) { 252 + w.Header().Set("Content-Type", "application/json") 253 + w.Write([]byte(manifestJson)) 254 + } 255 + 201 256 func (s *State) TermsOfService(w http.ResponseWriter, r *http.Request) { 202 257 user := s.oauth.GetUser(r) 203 258 s.pages.TermsOfService(w, pages.TermsOfServiceParams{
appview/pages/pwa-icons/pwa-144.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-192.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-48.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-512.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-72.png

This is a binary file and will not be displayed.

appview/pages/pwa-icons/pwa-96.png

This is a binary file and will not be displayed.

+2
flake.nix
··· 167 167 mkdir -p appview/pages/static 168 168 # no preserve is needed because watch-tailwind will want to be able to overwrite 169 169 cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static 170 + cp -fr appview/pages/pwa-icons/* appview/pages/static 170 171 export TANGLED_OAUTH_JWKS="$(${packages'.genjwks}/bin/genjwks)" 171 172 ''; 172 173 env.CGO_ENABLED = 1; ··· 200 201 program = toString (pkgs.writeShellScript "watch-appview" '' 201 202 echo "copying static files to appview/pages/static..." 202 203 ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static 204 + ${pkgs.coreutils}/bin/cp -fr appview/pages/pwa-icons/* appview/pages/static 203 205 ${air-watcher "appview" ""}/bin/run 204 206 ''); 205 207 };

History

1 round 0 comments
sign up or login to add to the discussion
vielle.dev submitted #0
2 commits
expand
appview/state,appview/pages/templates: add installable pwa support for tangled
appview/pages: add png icons to pwa manifest
expand 0 comments
closed without merging