dispatch/server/index.go

50 lines
1.3 KiB
Go
Raw Normal View History

2018-12-17 13:41:24 +00:00
package server
2016-03-16 22:23:16 +00:00
2018-12-17 13:41:24 +00:00
type indexTemplateData struct {
InlineScript string
2019-01-25 01:32:22 +00:00
Stylesheet string
2018-12-17 13:41:24 +00:00
Scripts []string
}
const indexTemplate = `
2016-03-16 22:23:16 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2019-01-25 01:32:22 +00:00
<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>
2019-01-25 01:32:22 +00:00
{{if .InlineScript}}
2018-12-17 13:41:24 +00:00
<script>{{.InlineScript}}</script>
2019-01-25 01:32:22 +00:00
{{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>
2018-11-06 10:13:32 +00:00
2019-01-25 01:32:22 +00:00
{{if .Stylesheet}}
2020-05-18 09:53:29 +00:00
<link rel="stylesheet" href="{{.Stylesheet}}">
2018-12-17 13:41:24 +00:00
{{end}}
<link rel="manifest" href="/manifest.json">
2020-05-05 01:34:36 +00:00
<link rel="apple-touch-icon" href="/icon_192.png">
</head>
<body>
<noscript>This page needs JavaScript enabled to function.</noscript>
2019-01-25 01:32:22 +00:00
<div id="root"></div>
2020-05-18 09:53:29 +00:00
{{range .Scripts}}
<script src="{{.}}"></script>
{{end}}
</body>
2018-12-17 13:41:24 +00:00
</html>`