Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Templater = tmplutil.Templater{ FileSystem: tmplutil.OverrideFS(webFS, os.DirFS("frontend")), Includes: map[string]string{ "css": "components/css.html", "error": "components/error.html", "header": "components/header.html", "footer": "components/footer.html", }, Functions: template.FuncMap{ "RFC3339": func() string { return time.RFC3339 }, "RelTime": func(t time.Time) string { return humanize.Time(t) }, "RelDurationShort": func(d time.Duration) string { return duration.Short(d) }, "RelDurationLong": func(d time.Duration) string { return duration.Long(d) }, }, OnRenderFail: func(sub *tmplutil.Subtemplate, w io.Writer, err error) { sub.Templater().Execute(w, "error", err) }, }
Functions ¶
func MountStatic ¶
MountStatic mounts the /static directory. Note that the returned handler will only handle /static paths, so it's safe to mount this to /static directly.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.