chore: add favicon
This commit is contained in:
parent
f71e50fbe6
commit
4a6dc34692
39
app.favicon.go
Normal file
39
app.favicon.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
|
||||
"go.sour.is/pkg/lg"
|
||||
"go.sour.is/pkg/service"
|
||||
)
|
||||
|
||||
var _ = apps.Register(10, func(ctx context.Context, svc *service.Harness) error {
|
||||
_, span := lg.Span(ctx)
|
||||
defer span.End()
|
||||
|
||||
svc.Add(&favicon{})
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
//go:embed favicon/*
|
||||
var faviconAsset embed.FS
|
||||
|
||||
type favicon struct{}
|
||||
|
||||
func (favicon) RegisterHTTP(mux *http.ServeMux) {
|
||||
dir, _ := fs.Sub(faviconAsset, "favicon")
|
||||
srv := http.FileServer(http.FS(dir))
|
||||
|
||||
mux.Handle("/favicon.ico", srv)
|
||||
mux.Handle("/favicon.txt", srv)
|
||||
mux.Handle("/favicon-16x16.png", srv)
|
||||
mux.Handle("/favicon-32x32.png", srv)
|
||||
mux.Handle("/android-chrome-192x192.png", srv)
|
||||
mux.Handle("/android-chrome-512x512.png", srv)
|
||||
mux.Handle("/apple-touch-icon.png", srv)
|
||||
mux.Handle("/site.webmanifest", srv)
|
||||
}
|
BIN
favicon/android-chrome-192x192.png
Normal file
BIN
favicon/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
BIN
favicon/android-chrome-512x512.png
Normal file
BIN
favicon/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
favicon/apple-touch-icon.png
Normal file
BIN
favicon/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
BIN
favicon/favicon-16x16.png
Normal file
BIN
favicon/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 472 B |
BIN
favicon/favicon-32x32.png
Normal file
BIN
favicon/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 847 B |
BIN
favicon/favicon.ico
Normal file
BIN
favicon/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
6
favicon/favicon.txt
Normal file
6
favicon/favicon.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
This favicon was generated using the following graphics from Twitter Twemoji:
|
||||
|
||||
- Graphics Title: 1f4cb.svg
|
||||
- Graphics Author: Copyright 2020 Twitter, Inc and other contributors (https://github.com/twitter/twemoji)
|
||||
- Graphics Source: https://github.com/twitter/twemoji/blob/master/assets/svg/1f4cb.svg
|
||||
- Graphics License: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
|
1
favicon/site.webmanifest
Normal file
1
favicon/site.webmanifest
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"sour.is paste","short_name":"paste","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
Loading…
Reference in New Issue
Block a user