-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex.go
49 lines (37 loc) · 1.28 KB
/
index.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package server
type indexTemplateData struct {
InlineScript string
Stylesheet string
Scripts []string
}
const indexTemplate = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#222">
<title>Dispatch</title>
<meta name="description" content="Web-based IRC client.">
<link rel="preload" href="/init" as="fetch" crossorigin>
{{if .InlineScript}}
<script>{{.InlineScript}}</script>
{{end}}
<link rel="preload" href="/font/RobotoMono-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/Montserrat-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/Montserrat-Bold.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/font/RobotoMono-Bold.woff2" as="font" type="font/woff2" crossorigin>
{{if .Stylesheet}}
<link rel="stylesheet" href="{{.Stylesheet}}">
{{end}}
<link rel="manifest" href="/manifest.json">
<link rel="apple-touch-icon" href="/icon_192.png">
</head>
<body>
<noscript>This page needs JavaScript enabled to function.</noscript>
<div id="root"></div>
{{range .Scripts}}
<script src="{{.}}"></script>
{{end}}
</body>
</html>`