Notes2/page.go
Magnus Åhall 5c2842c995 wip
2024-11-30 17:10:46 +01:00

34 lines
448 B
Go

package main
import (
// Internal
"notes2/html_template"
)
type Page struct {
HTMLTemplate.SimplePage
Data map[string]any
}
func NewPage(page string) (p Page) {
p.Page = page
p.Data = make(map[string]any)
return
}
func (p Page) GetVersion() string {
return VERSION
}
func (p Page) GetLayout() string {
if p.Layout == "" {
return "main"
}
return p.Layout
}
func (p Page) GetData() any {
p.Data["_dev"] = FlagDev
return p.Data
}