Documentation
¶
Index ¶
- type BasePage
- type Template
- func (t *Template) NewBasePage(_ *http.Request, title string) BasePage
- func (t *Template) RenderPage(templateName string, page any) ([]byte, error)
- func (t *Template) ServePage(w http.ResponseWriter, templateName string, page any)
- func (t *Template) StaticPageHandler(templateName, title string) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasePage ¶
type BasePage struct {
// HTMLTitle is the value to use in the page’s <title> tag.
HTMLTitle string
// MetaDescription is the html used for rendering the <meta name="Description"> tag.
MetaDescription safehtml.HTML
}
BasePage for structure data pass to template
type Template ¶
func (*Template) NewBasePage ¶
newBasePage returns a base page for the given request and title.
func (*Template) RenderPage ¶
renderPage executes the given templateName with page.
func (*Template) ServePage ¶
func (t *Template) ServePage(w http.ResponseWriter, templateName string, page any)
servePage is used to execute all templates for a *Server.
func (*Template) StaticPageHandler ¶
func (t *Template) StaticPageHandler(templateName, title string) http.HandlerFunc
staticPageHandler handles requests to a template that contains no dynamic content.
Click to show internal directories.
Click to hide internal directories.