Moved index.go to go:embed (#392)

This commit is contained in:
FileGo 2022-01-01 21:32:22 +00:00 committed by GitHub
parent f0b1bd09d1
commit 9259c5cdcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 16 deletions

View File

@ -1,19 +1,7 @@
package web
// IndexTmpl html template for the start page
const IndexTmpl = `<!DOCTYPE html>
<html>
<head>
<title>blocky</title>
</head>
<body>
<h1>blocky</h1>
<ul>
{{range .Links}}
<li><a href="{{.URL}}">{{.Title}}</a></li>
{{end}}
</ul>
import _ "embed"
<p><span class="small">Version {{.Version}} Build time {{.BuildTime}}</span></p>
</body>
</html>`
// IndexTmpl html template for the start page
//go:embed index.html
var IndexTmpl string

16
web/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>blocky</title>
</head>
<body>
<h1>blocky</h1>
<ul>
{{range .Links}}
<li><a href="{{.URL}}">{{.Title}}</a></li>
{{end}}
</ul>
<p><span class="small">Version {{.Version}} Build time {{.BuildTime}}</span></p>
</body>
</html>