Documentation
¶
Index ¶
- type Context
- type ContextBuilder
- type ContextData
- type Pages
- func (p *Pages) BuildPageContext(c echo.Context, title string) *Context
- func (p *Pages) Redirect(c echo.Context, code int, target string) error
- func (p *Pages) RedirectToPage(c echo.Context, name string, params ...interface{}) error
- func (p *Pages) RegisterContextBuilder(b ContextBuilder)
- func (p *Pages) RegisterHelpers(helpers map[string]interface{})
- func (p *Pages) Render(c echo.Context, name string, data *Context) error
- func (p *Pages) RenderWithSidebar(c echo.Context, name, sidebar string, data *Context) error
- type RequestInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
NakedContent bool
Page *page
Sidebar *page
NoBoost bool
HotReload bool
OfficialInstance bool
GreyLogo bool
RequestInfo RequestInfo
PlausibleScript string
CurrentSection string
Title string
UserID string
UserLoggedIn bool
UserHasAccount bool
HasNews bool
Preferences *db.UserPreference
CSRFToken string
Data ContextData
}
type ContextBuilder ¶ added in v0.18.0
type ContextData ¶
type ContextData map[string]interface{}
type Pages ¶
type Pages struct {
// contains filtered or unexported fields
}
Pages holds parsed pages ready for rendering
func (*Pages) BuildPageContext ¶ added in v0.18.0
func (*Pages) RedirectToPage ¶ added in v0.18.0
RedirectToPage the user to another page, either via htmx client-side Redirect (form submissions) or http 302 Redirect (direct access, js disabled)
func (*Pages) RegisterContextBuilder ¶ added in v0.18.0
func (p *Pages) RegisterContextBuilder(b ContextBuilder)
func (*Pages) RegisterHelpers ¶
type RequestInfo ¶
type RequestInfo interface {
// Request returns `*http.Request`.
Request() *http.Request
// Scheme returns the HTTP protocol scheme, `http` or `https`.
Scheme() string
}
RequestInfo is a subset of echo.Context
Click to show internal directories.
Click to hide internal directories.