Monorepo for Tangled tangled.org
9

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: add PWA icons for Android and iOS

Closes TAN-515

Signed-off-by: eti <eti@eti.tf>

+21 -9
+2
.gitignore
··· 9 9 result 10 10 !.gitkeep 11 11 !appview/pages/static/topbar-search.js 12 + !appview/pages/static/pwa-icons/ 13 + !appview/pages/static/pwa-icons/** 12 14 out/ 13 15 node_modules/ 14 16 patches
appview/pages/static/pwa-icons/android/144.png

This is a binary file and will not be displayed.

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

This is a binary file and will not be displayed.

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

This is a binary file and will not be displayed.

appview/pages/static/pwa-icons/ios/152.png

This is a binary file and will not be displayed.

appview/pages/static/pwa-icons/ios/167.png

This is a binary file and will not be displayed.

appview/pages/static/pwa-icons/ios/180.png

This is a binary file and will not be displayed.

+3 -1
appview/pages/templates/layouts/base.html
··· 27 27 28 28 <link rel="icon" href="/static/logos/dolly.ico" sizes="48x48"/> 29 29 <link rel="icon" href="/static/logos/dolly.svg" sizes="any" type="image/svg+xml"/> 30 - <link rel="apple-touch-icon" href="/static/logos/dolly.png"/> 30 + <link rel="apple-touch-icon" sizes="180x180" href="/static/pwa-icons/ios/180.png"/> 31 + <link rel="apple-touch-icon" sizes="167x167" href="/static/pwa-icons/ios/167.png"/> 32 + <link rel="apple-touch-icon" sizes="152x152" href="/static/pwa-icons/ios/152.png"/> 31 33 32 34 <!-- preconnect to image cdn --> 33 35 <link rel="preconnect" href="https://avatar.tangled.sh" />
+16 -8
appview/state/manifest.go
··· 8 8 // https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest 9 9 // https://www.w3.org/TR/appmanifest/ 10 10 var manifestData = map[string]any{ 11 - "name": "tangled", 12 - "description": "tightly-knit social coding.", 13 - "icons": []map[string]string{ 14 - { 15 - "src": "/static/logos/dolly.svg", 16 - "sizes": "144x144", 17 - }, 18 - }, 11 + "name": "tangled", 12 + "description": "tightly-knit social coding.", 13 + "icons": manifestIcons(), 19 14 "start_url": "/", 20 15 "id": "https://tangled.org", 21 16 "display": "standalone", 22 17 "background_color": "#111827", 23 18 "theme_color": "#111827", 19 + } 20 + 21 + func manifestIcons() []map[string]string { 22 + sizes := []string{"144", "192", "512"} 23 + icons := make([]map[string]string, 0, len(sizes)) 24 + for _, size := range sizes { 25 + icons = append(icons, map[string]string{ 26 + "src": "/static/pwa-icons/android/" + size + ".png", 27 + "sizes": size + "x" + size, 28 + "type": "image/png", 29 + }) 30 + } 31 + return icons 24 32 } 25 33 26 34 func (p *State) WebAppManifest(w http.ResponseWriter, r *http.Request) {