Documentation
¶
Overview ¶
Package html provides a HTML renderer.
Index ¶
Constants ¶
View Source
const ( Extension = ".htm" BlocksPrefix = "blocks/" PartialsPrefix = "partials/" LayoutsPrefix = "layouts/" PagesPrefix = "pages/" DefaultLanguage = "en" DefaultLayout = "default" DefaultRobotsIndex = true DefaultRobotsFollow = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents a block in a template.
type Html ¶
type Html struct {
*Options
Blocks Blocks
Partials Partials
Layouts Layouts
Pages Pages
// contains filtered or unexported fields
}
Html represents a HTML renderer.
type Layout ¶
type Layout struct {
Variables pongo2.Context `yaml:"Variables"`
// contains filtered or unexported fields
}
Layout represents a layout in a template.
type Option ¶
type Option func(o *Options)
Option represents the service option.
func WithDirectory ¶
WithDirectory sets the directory for the options.
func WithFilters ¶
func WithFilters(value map[string]pongo2.FilterFunction) Option
WithFilters sets the filters for the options.
func WithVariables ¶
WithVariables sets the variables for the options.
type Options ¶
type Options struct {
Directory string `json:"directory" yaml:"Directory"`
Debug bool `json:"debug" yaml:"Debug"`
Minify bool `json:"minify" yaml:"Minify"`
Cache bool `json:"cache" yaml:"Cache"`
Variables pongo2.Context `json:"variables" yaml:"Variables"`
// contains filtered or unexported fields
}
Options represents a HTML renderer configuration.
type Page ¶
type Page struct {
Title string `yaml:"Title"`
Description string `yaml:"Description"`
Keywords []string `yaml:"Keywords"`
Language string `yaml:"Language"`
Path string `yaml:"Path"`
Layout string `yaml:"Layout"`
Author string `yaml:"Author"`
RobotsIndex bool `yaml:"RobotsIndex"`
RobotsFollow bool `yaml:"RobotsFollow"`
Draft bool `yaml:"Draft"`
Static bool `yaml:"Static"`
SitemapChangeFrequency string `yaml:"SitemapChangeFrequency"`
SitemapPriority float64 `yaml:"SitemapPriority"`
CreatedAt time.Time `yaml:"CreatedAt"`
UpdatedAt time.Time `yaml:"UpdatedAt"`
Variables pongo2.Context `yaml:"Variables"`
// contains filtered or unexported fields
}
Page represents a page in a template.
type Partial ¶
type Partial struct {
// contains filtered or unexported fields
}
Partial represents a partial in a template.
func NewPartial ¶
func NewPartial(set *pongo2.TemplateSet, name string, content []byte, minify bool) (p *Partial, err error)
NewPartial creates a new Partial from the given content.
Click to show internal directories.
Click to hide internal directories.