+29
appview/state/manifest.go
+29
appview/state/manifest.go
···
1
+
package state
2
+
3
+
import (
4
+
"encoding/json"
5
+
"net/http"
6
+
)
7
+
8
+
// https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest
9
+
// https://www.w3.org/TR/appmanifest/
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
+
},
19
+
"start_url": "/",
20
+
"id": "https://tangled.org",
21
+
"display": "standalone",
22
+
"background_color": "#111827",
23
+
"theme_color": "#111827",
24
+
}
25
+
26
+
func (p *State) WebAppManifest(w http.ResponseWriter, r *http.Request) {
27
+
w.Header().Set("Content-Type", "application/manifest+json")
28
+
json.NewEncoder(w).Encode(manifestData)
29
+
}
+1
-1
appview/state/router.go
+1
-1
appview/state/router.go
-23
appview/state/state.go
-23
appview/state/state.go
···
212
212
w.Write([]byte(robotsTxt))
213
213
}
214
214
215
-
// https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest
216
-
const manifestJson = `{
217
-
"name": "tangled",
218
-
"description": "tightly-knit social coding.",
219
-
"icons": [
220
-
{
221
-
"src": "/favicon.svg",
222
-
"sizes": "144x144"
223
-
}
224
-
],
225
-
"start_url": "/",
226
-
"id": "org.tangled",
227
-
228
-
"display": "standalone",
229
-
"background_color": "#111827",
230
-
"theme_color": "#111827"
231
-
}`
232
-
233
-
func (p *State) PWAManifest(w http.ResponseWriter, r *http.Request) {
234
-
w.Header().Set("Content-Type", "application/json")
235
-
w.Write([]byte(manifestJson))
236
-
}
237
-
238
215
func (s *State) TermsOfService(w http.ResponseWriter, r *http.Request) {
239
216
user := s.oauth.GetUser(r)
240
217
s.pages.TermsOfService(w, pages.TermsOfServiceParams{
+1
-1
cmd/dolly/main.go
+1
-1
cmd/dolly/main.go
+6
docs/logo.html
+6
docs/logo.html
+7
-6
docs/template.html
+7
-6
docs/template.html
···
74
74
${ x.svg() }
75
75
$if(toc-title)$$toc-title$$else$Table of Contents$endif$
76
76
</button>
77
+
${ logo.html() }
77
78
${ search.html() }
78
79
${ table-of-contents:toc.html() }
79
80
</div>
···
88
89
class="hidden md:flex md:flex-col gap-4 fixed left-0 top-0 w-80 h-screen
89
90
bg-gray-50 dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700
90
91
p-4 z-50 overflow-y-auto">
92
+
${ logo.html() }
91
93
${ search.html() }
92
94
<div class="flex-1">
93
95
$if(toc-title)$
···
118
120
$endif$
119
121
$endif$
120
122
</header>
121
-
$endif$
122
-
123
-
$if(abstract)$
124
-
<article class="prose dark:prose-invert max-w-none">
125
-
$abstract$
126
-
</article>
123
+
$if(abstract)$
124
+
<article class="prose dark:prose-invert max-w-none">
125
+
$abstract$
126
+
</article>
127
+
$endif$
127
128
$endif$
128
129
129
130
<article class="prose dark:prose-invert max-w-none">
+1
-1
nix/pkgs/appview-static-files.nix
+1
-1
nix/pkgs/appview-static-files.nix
···
30
30
31
31
${dolly}/bin/dolly -output logos/dolly.png -size 180x180
32
32
${dolly}/bin/dolly -output logos/dolly.ico -size 48x48
33
-
${dolly}/bin/dolly -output logos/dolly.svg
33
+
${dolly}/bin/dolly -output logos/dolly.svg -color currentColor
34
34
# tailwindcss -c $src/tailwind.config.js -i $src/input.css -o tw.css won't work
35
35
# for whatever reason (produces broken css), so we are doing this instead
36
36
cd ${src} && ${tailwindcss}/bin/tailwindcss -i input.css -o $out/tw.css
+4
nix/pkgs/docs.nix
+4
nix/pkgs/docs.nix
···
5
5
inter-fonts-src,
6
6
ibm-plex-mono-src,
7
7
lucide-src,
8
+
dolly,
8
9
src,
9
10
}:
10
11
runCommandLocal "docs" {} ''
···
17
18
18
19
# icons
19
20
cp -rf ${lucide-src}/*.svg working/
21
+
22
+
# logo
23
+
${dolly}/bin/dolly -output working/dolly.svg -color currentColor
20
24
21
25
# content - chunked
22
26
${pandoc}/bin/pandoc ${src}/docs/DOCS.md \