arimelody-web/templates/templates.go

37 lines
974 B
Go
Raw Normal View History

package templates
import (
2025-09-30 19:03:35 +01:00
_ "embed"
"html/template"
"strings"
)
2025-09-30 19:03:35 +01:00
//go:embed "html/layout.html"
var layoutHTML string
//go:embed "html/header.html"
var headerHTML string
//go:embed "html/footer.html"
var footerHTML string
//go:embed "html/prideflag.html"
var prideflagHTML string
//go:embed "html/index.html"
var indexHTML string
//go:embed "html/music.html"
var musicHTML string
//go:embed "html/music-gateway.html"
var musicGatewayHTML string
// //go:embed "html/404.html"
// var error404HTML string
var BaseTemplate = template.Must(template.New("base").Parse(
strings.Join([]string{
layoutHTML,
headerHTML,
footerHTML,
prideflagHTML,
}, "\n"),
))
2025-09-30 19:03:35 +01:00
var IndexTemplate = template.Must(template.Must(BaseTemplate.Clone()).Parse(indexHTML))
var MusicTemplate = template.Must(template.Must(BaseTemplate.Clone()).Parse(musicHTML))
var MusicGatewayTemplate = template.Must(template.Must(BaseTemplate.Clone()).Parse(musicGatewayHTML))