diff --git a/internal/server/server.go b/internal/server/server.go index 2ca7ab2..297351f 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -10,6 +10,7 @@ import ( "io" "io/fs" "log" + "mime" "net/http" "path" "runtime/debug" @@ -35,6 +36,12 @@ type Server struct { jobs *jobRunner } +func init() { + // not in Go's built-in table on every platform + mime.AddExtensionType(".webmanifest", "application/manifest+json") + mime.AddExtensionType(".ico", "image/x-icon") +} + func New(db *sql.DB, cfg config.Config, box *secure.Box, ui fs.FS) *Server { s := &Server{db: db, cfg: cfg, box: box, ui: ui, mux: http.NewServeMux(), limiter: newLoginLimiter()} s.routes() diff --git a/web/src/app.html b/web/src/app.html index 410c8bf..2b04b9b 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -4,6 +4,10 @@ + + + + %sveltekit.head% diff --git a/web/static/apple-touch-icon.png b/web/static/apple-touch-icon.png new file mode 100644 index 0000000..d0874a3 Binary files /dev/null and b/web/static/apple-touch-icon.png differ diff --git a/web/static/favicon.ico b/web/static/favicon.ico new file mode 100644 index 0000000..55bb10a Binary files /dev/null and b/web/static/favicon.ico differ diff --git a/web/static/icon-192.png b/web/static/icon-192.png new file mode 100644 index 0000000..bb0ef98 Binary files /dev/null and b/web/static/icon-192.png differ diff --git a/web/static/icon-512.png b/web/static/icon-512.png new file mode 100644 index 0000000..9d14e42 Binary files /dev/null and b/web/static/icon-512.png differ diff --git a/web/static/icon-maskable-512.png b/web/static/icon-maskable-512.png new file mode 100644 index 0000000..c7855fd Binary files /dev/null and b/web/static/icon-maskable-512.png differ diff --git a/web/static/manifest.webmanifest b/web/static/manifest.webmanifest new file mode 100644 index 0000000..e25dc56 --- /dev/null +++ b/web/static/manifest.webmanifest @@ -0,0 +1,14 @@ +{ + "name": "LowLex", + "short_name": "LowLex", + "description": "A light translation server", + "start_url": "/projects", + "display": "standalone", + "background_color": "#171a17", + "theme_color": "#171a17", + "icons": [ + { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }, + { "src": "/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } + ] +}