Documentation
¶
Index ¶
- Constants
- func Bootstrap(r *gin.Engine, group *PageGroup)
- func ParentLayout(group *PageGroup) string
- type Mode
- type Page
- type PageGroup
- type Pages
- func (p *Pages) AddFunc(name string, fn any)
- func (r *Pages) AddTemplate(name string, filenames ...string) error
- func (p *Pages) AddTemplatesFromGroup(group *PageGroup) error
- func (p *Pages) BootstrapGin(ginEngin *gin.Engine, group *PageGroup)
- func (p *Pages) Count() int
- func (p *Pages) GetFuncMap() template.FuncMap
- func (p *Pages) Init(props *PagesProps) error
- func (p *Pages) Instance(name string, data any) render.Render
- func (p *Pages) LoadDefault(root *template.Template, path string) *template.Template
- func (p *Pages) LoadLocal(root *template.Template, filenames ...string) *template.Template
- type PagesProps
Constants ¶
View Source
const ( ModeDefault = iota ModeLocal ModeS3 )
Variables ¶
This section is empty.
Functions ¶
func Bootstrap ¶
Bootstrap configures gin router according to a tree of PageGroups The next step is to configure gin.Engine renderer using Pages.
func ParentLayout ¶
Types ¶
type PageGroup ¶
type PageGroup struct {
Dir string
Index string
Layout string
Path string
Pages []*Page
Parent *PageGroup
Groups []*PageGroup
}
PageGroup provides a general view of the directory where templates and other directories exist.
func PageParseWithParent ¶
type Pages ¶
type Pages struct {
Mode Mode
WithCache bool
Root *PageGroup
// Pages directory where templates are located (default: pages)
Pages string
// contains filtered or unexported fields
}
Pages is the root instance
func NewPagesWithProps ¶
func NewPagesWithProps(props *PagesProps) *Pages
func (*Pages) AddTemplatesFromGroup ¶
func (*Pages) GetFuncMap ¶
func (*Pages) Init ¶
func (p *Pages) Init(props *PagesProps) error
func (*Pages) LoadDefault ¶
type PagesProps ¶
Click to show internal directories.
Click to hide internal directories.