Yōten: A social tracker for your language learning journey built on the atproto.

feat: add pwa configuration

Signed-off-by: brookjeynes <me@brookjeynes.dev>

brookjeynes.dev 44840518 9f2b1a70

verified
+24
+1
internal/server/handlers/router.go
··· 46 46 r.Handle("/static/*", h.HandleStatic()) 47 47 r.Get("/favicon.svg", h.HandleFavicon) 48 48 r.Get("/favicon.ico", h.HandleFavicon) 49 + r.Get("/pwa-manifest.json", h.PWAManifest) 49 50 50 51 r.Get("/", h.HandleIndexPage) 51 52 r.Get("/feed", h.HandleStudySessionFeed)
+22
internal/server/handlers/static.go
··· 65 65 66 66 partials.Logo().Render(r.Context(), w) 67 67 } 68 + 69 + // https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest 70 + const manifestJson = `{ 71 + "name": "Yōten", 72 + "description": "A social tracker for your language learning journey.", 73 + "icons": [ 74 + { 75 + "src": "/favicon.svg", 76 + "sizes": "200x200" 77 + } 78 + ], 79 + "start_url": "/", 80 + "id": "app.yoten", 81 + "display": "standalone", 82 + "background_color": "#111827", 83 + "theme_color": "#111827" 84 + }` 85 + 86 + func (h *Handler) PWAManifest(w http.ResponseWriter, r *http.Request) { 87 + w.Header().Set("Content-Type", "application/json") 88 + w.Write([]byte(manifestJson)) 89 + }
+1
internal/server/views/layouts/base.templ
··· 12 12 <script src="/static/alpinejs.min.js" defer></script> 13 13 <script src="/static/htmx-toaster.min.js" defer></script> 14 14 <link rel="stylesheet" href="/static/style.css" type="text/css"/> 15 + <link rel="manifest" href="/pwa-manifest.json"/> 15 16 </head> 16 17 <body class="flex flex-col min-h-screen bg-bg"> 17 18 <htmx-toaster max-toasts="4" duration="7000"></htmx-toaster>