Documentation ¶
Index ¶
- type EngineContext
- type PageContext
- func (p *PageContext) Content() interface{}
- func (p *PageContext) CreatedAt() time.Time
- func (p *PageContext) Data(key string) interface{}
- func (p *PageContext) PublishedAt() time.Time
- func (p *PageContext) Route() string
- func (p *PageContext) Template() string
- func (p *PageContext) Theme() string
- func (p *PageContext) Title() string
- func (p *PageContext) UpdatedAt() time.Time
- type SiteContext
- type SortablePages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineContext ¶
type EngineContext struct {
// contains filtered or unexported fields
}
EngineContext provides functions to templates
func NewContext ¶
func NewContext(l logger.Logger, page *models.Page, backend db.Backend, contents map[string]interface{}) *EngineContext
NewContext returns a new EngineContext
type PageContext ¶
type PageContext struct {
// contains filtered or unexported fields
}
PageContext wraps page related data
func (*PageContext) Content ¶
func (p *PageContext) Content() interface{}
Content is shorthand for accessing page content.
func (*PageContext) CreatedAt ¶
func (p *PageContext) CreatedAt() time.Time
CreatedAt is shorthand for accessing page created at time
func (*PageContext) Data ¶
func (p *PageContext) Data(key string) interface{}
Data returns rendered page data for the given key
func (*PageContext) PublishedAt ¶
func (p *PageContext) PublishedAt() time.Time
PublishedAt is shorthand for accessing page published at time
func (*PageContext) Template ¶
func (p *PageContext) Template() string
func (*PageContext) Theme ¶
func (p *PageContext) Theme() string
func (*PageContext) Title ¶
func (p *PageContext) Title() string
Title is shorthand for accessing page title
func (*PageContext) UpdatedAt ¶
func (p *PageContext) UpdatedAt() time.Time
UpdatedAt is shorthand for accessing page updated at time
type SiteContext ¶
type SiteContext struct {
*EngineContext
}
SiteContext wraps engine context and provides site related functions.
func (*SiteContext) Data ¶
func (s *SiteContext) Data(key string) interface{}
Data returns rendered site data for the given key
func (*SiteContext) Pages ¶
func (s *SiteContext) Pages() SortablePages
func (*SiteContext) Title ¶
func (s *SiteContext) Title() interface{}
Title is shorthand for accessing site title
type SortablePages ¶
type SortablePages []*PageContext
func (SortablePages) ByPublishedAt ¶
func (p SortablePages) ByPublishedAt() SortablePages
func (SortablePages) Reverse ¶
func (p SortablePages) Reverse() SortablePages
Click to show internal directories.
Click to hide internal directories.