Versions in this module Expand all Collapse all v0 v0.0.2 Oct 25, 2024 Changes in this version + const DefaultBaseLayout + const ErrTempNotFound + const ErrTempParse + const ErrTempRender + const LayoutsDir + const NonceContextKey + const PartialsDir + const SystemDir + const ViewsDir + func DefaultFuncMap() template.FuncMap + func MergeFuncMaps(funcMap template.FuncMap) template.FuncMap + type Response struct + func NewResponse(tm *TemplateManager) *Response + func (resp *Response) AddData(data map[string]any) *Response + func (resp *Response) AddDataItem(key string, value any) *Response + func (resp *Response) CacheControl(cacheControl string) + func (resp *Response) Data(data map[string]any) *Response + func (resp *Response) ETag(etag string) + func (resp *Response) Errors(msg string, fieldErrors map[string]string) *Response + func (resp *Response) HTTPHeader() http.Header + func (resp *Response) Header(key, value string) *Response + func (resp *Response) Headers() map[string]string + func (resp *Response) HxLayout(r *http.Request, hxLayout, layout string) *Response + func (resp *Response) HxLocation(path string, opt ...location.Option) *Response + func (resp *Response) HxNoPushURL() *Response + func (resp *Response) HxNoRefresh() *Response + func (resp *Response) HxNoReplaceURL() *Response + func (resp *Response) HxPushURL(path string) *Response + func (resp *Response) HxRedirect(path string) *Response + func (resp *Response) HxRefresh() *Response + func (resp *Response) HxReplaceURL(path string) *Response + func (resp *Response) HxReselect(reselect string) *Response + func (resp *Response) HxReswap(swap *swap.Style) *Response + func (resp *Response) HxRetarget(target string) *Response + func (resp *Response) HxTrigger(event string, value any) *Response + func (resp *Response) HxTriggerAfterSettle(event string, value any) *Response + func (resp *Response) HxTriggerAfterSwap(event string, value any) *Response + func (resp *Response) LastModified(lastModified string) + func (resp *Response) Layout(layout string) *Response + func (resp *Response) NoCacheStrict() + func (resp *Response) PageTitle() string + func (resp *Response) Path(path string) *Response + func (resp *Response) Render(w http.ResponseWriter, r *http.Request) + func (resp *Response) RenderForbidden(w http.ResponseWriter, r *http.Request) + func (resp *Response) RenderMaintenance(w http.ResponseWriter, r *http.Request) + func (resp *Response) RenderMethodNotAllowed(w http.ResponseWriter, r *http.Request) + func (resp *Response) RenderNotFound(w http.ResponseWriter, r *http.Request) + func (resp *Response) RenderSystemError(w http.ResponseWriter, r *http.Request, err error) + func (resp *Response) RenderUnauthorized(w http.ResponseWriter, r *http.Request) + func (resp *Response) ResetData(data *ResponseData) *Response + func (resp *Response) Status(status int) *Response + func (resp *Response) StatusAccepted() *Response + func (resp *Response) StatusCode() int + func (resp *Response) StatusCreated() *Response + func (resp *Response) StatusError() *Response + func (resp *Response) StatusForbidden() *Response + func (resp *Response) StatusNoContent() *Response + func (resp *Response) StatusNotFound() *Response + func (resp *Response) StatusOK() *Response + func (resp *Response) StatusStopPolling() *Response + func (resp *Response) StatusUnauthorized() *Response + func (resp *Response) StatusUnavailable() *Response + func (resp *Response) StatusUnprocessable() *Response + func (resp *Response) TemplateLayout() string + func (resp *Response) TemplatePath() string + func (resp *Response) Title(title string) *Response + func (resp *Response) ViewData(r *http.Request) *ResponseData + type ResponseData struct + func NewResponseData(pageData map[string]any) *ResponseData + func (v *ResponseData) AddData(data map[string]any) + func (v *ResponseData) AddDataItem(key string, value any) + func (v *ResponseData) AddErrors(msg string, fieldErrors map[string]string) + func (v *ResponseData) BaseURL() string + func (v *ResponseData) Context() context.Context + func (v *ResponseData) CurrentYear() int + func (v *ResponseData) Data() map[string]any + func (v *ResponseData) Error() string + func (v *ResponseData) Errors() map[string]string + func (v *ResponseData) Get(key string) any + func (v *ResponseData) GetString(key string) string + func (v *ResponseData) HasError() bool + func (v *ResponseData) HasErrors() bool + func (v *ResponseData) HxNonce() string + func (v *ResponseData) IsBoostedRequest() bool + func (v *ResponseData) IsHtmxRequest() bool + func (v *ResponseData) Nonce() string + func (v *ResponseData) RequestMethod() string + func (v *ResponseData) RequestPath() string + func (v *ResponseData) SetRequest(r *http.Request) + func (v *ResponseData) SetTitle(title string) + func (v *ResponseData) Title() string + type Sources map[string]fs.FS + type TemplateManager struct + func NewTemplateManager(sources Sources, opts TemplateManagerOptions) (*TemplateManager, error) + func (tm *TemplateManager) LoadTemplates() error + func (tm *TemplateManager) NewResponse() *Response + type TemplateManagerOptions struct + BaseLayout string + Extension string + Funcs template.FuncMap + Logger *slog.Logger + SystemLayout string