You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
caddy-hugo2/frontend/templates.go

30 lines
534 B

package frontend
import "embed"
//go:embed templates
var templates embed.FS
func readFilename(filename string) string {
f, err := templates.ReadFile(filename)
if err != nil {
panic(err)
}
return string(f)
}
func EditPage() string {
return readFilename("templates/edit.html.tmpl")
}
func AdminPage() string {
return readFilename("templates/admin.html.tmpl")
}
func AuthorPage() string {
return readFilename("templates/author.html.tmpl")
}
func UploadPage() string {
return readFilename("templates/upload.html.tmpl")
}