Documentation
¶
Index ¶
- Variables
- func AddParseTree(src, dst *template.Template) (err error)
- func AddRegisteredHtmlFuncsToMap(fm *htmlTemplate.FuncMap)
- func AddRegisteredTextFuncsToMap(fm *textTemplate.FuncMap)
- func DefaultFuncMap() (funcMap htmlTemplate.FuncMap)
- func GetFuncMap(key string) (fn interface{}, ok bool)
- func LookupTemplate(tt *template.Template, names ...string) (tmpl *template.Template)
- func RegisterFuncMap(key string, fn interface{})
- func RegisterPartialBodyHead(name, tmpl string)
- func RegisterPartialBodyTail(name, tmpl string)
- func RegisterPartialHeadHead(name, tmpl string)
- func RegisterPartialHeadTail(name, tmpl string)
- type Archetype
- type Author
- type Config
- type GoogleAnalyticsConfig
- type Layout
- func (l *Layout) Apply(tt *template.Template, ctx context.Context) (err error)
- func (l *Layout) HasKey(key string) bool
- func (l *Layout) NewTemplate(ctx context.Context) (tmpl *template.Template, err error)
- func (l *Layout) NewTemplateFrom(parent *Layout, ctx context.Context) (tmpl *template.Template, err error)
- func (l *Layout) Reload() (err error)
- type Layouts
- type Theme
- func (t *Theme) AddFormatProvider(providers ...types.FormatProvider)
- func (t *Theme) FS() fs.FileSystem
- func (t *Theme) FindLayout(named string) (layout *Layout, name string, ok bool)
- func (t *Theme) GetBlockThemeNames() (names []string)
- func (t *Theme) GetConfig() (config Config)
- func (t *Theme) GetFormat(name string) (format types.Format)
- func (t *Theme) GetParent() (parent *Theme)
- func (t *Theme) GetParentTheme() (parent types.Theme)
- func (t *Theme) ListFormats() (names []string)
- func (t *Theme) Locales() (locales fs.FileSystem, ok bool)
- func (t *Theme) MatchFormat(filename string) (format types.Format, match string)
- func (t *Theme) Middleware(next http.Handler) http.Handler
- func (t *Theme) NewHtmlFuncMapWithContext(ctx context.Context) (fm htmlTemplate.FuncMap)
- func (t *Theme) NewHtmlTemplateWithContext(name string, ctx context.Context) (tmpl *htmlTemplate.Template, err error)
- func (t *Theme) NewTextFuncMapWithContext(ctx context.Context) (fm textTemplate.FuncMap)
- func (t *Theme) NewTextTemplateWithContext(name string, ctx context.Context) (tmpl *textTemplate.Template, err error)
- func (t *Theme) Render(view string, ctx context.Context) (data []byte, err error)
- func (t *Theme) RenderHtmlTemplateContent(ctx context.Context, tmplContent string) (rendered string, err error)
- func (t *Theme) RenderPage(ctx context.Context, p *page.Page) (data []byte, redirect string, err error)
- func (t *Theme) RenderTextTemplateContent(ctx context.Context, tmplContent string) (rendered string, err error)
- func (t *Theme) TemplateFromContext(view string, ctx context.Context) (tt *htmlTemplate.Template, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultCacheControl = "public, max-age=604800, no-transform, immutable"
)
Functions ¶
func AddParseTree ¶
func AddRegisteredHtmlFuncsToMap ¶
func AddRegisteredHtmlFuncsToMap(fm *htmlTemplate.FuncMap)
func AddRegisteredTextFuncsToMap ¶
func AddRegisteredTextFuncsToMap(fm *textTemplate.FuncMap)
func DefaultFuncMap ¶
func DefaultFuncMap() (funcMap htmlTemplate.FuncMap)
func GetFuncMap ¶
func LookupTemplate ¶
func RegisterFuncMap ¶
func RegisterFuncMap(key string, fn interface{})
func RegisterPartialBodyHead ¶ added in v0.1.0
func RegisterPartialBodyHead(name, tmpl string)
func RegisterPartialBodyTail ¶ added in v0.1.0
func RegisterPartialBodyTail(name, tmpl string)
func RegisterPartialHeadHead ¶ added in v0.1.0
func RegisterPartialHeadHead(name, tmpl string)
func RegisterPartialHeadTail ¶ added in v0.1.0
func RegisterPartialHeadTail(name, tmpl string)
Types ¶
type Config ¶
type Config struct {
Name string
Parent string
License string
LicenseLink string
Description string
Homepage string
Authors []Author
Extends string
GoogleAnalytics GoogleAnalyticsConfig
RootStyles []template.CSS
BlockStyles map[string][]template.CSS
BlockThemes map[string]map[string]interface{}
FontawesomeLinks map[string]string
FontawesomeClasses []string
CacheControl string
PermissionsPolicy []permissions.Directive
ContentSecurityPolicy csp.ContentSecurityPolicyConfig
Context context.Context
}
type GoogleAnalyticsConfig ¶
type GoogleAnalyticsConfig struct {
GTM string
}
type Layout ¶
type Layout struct {
Path string
Name string
Keys []string
sync.RWMutex
// contains filtered or unexported fields
}
func (*Layout) NewTemplate ¶
func (*Layout) NewTemplateFrom ¶
type Theme ¶
type Theme struct {
Name string
Path string
Config Config
Minify bool
FuncMap template.FuncMap
Layouts *Layouts
Archetypes map[string]*Archetype
FileSystem fs.FileSystem
StaticFS fs.FileSystem
FormatProviders []types.FormatProvider
}
func (*Theme) AddFormatProvider ¶
func (t *Theme) AddFormatProvider(providers ...types.FormatProvider)
func (*Theme) FS ¶
func (t *Theme) FS() fs.FileSystem
func (*Theme) FindLayout ¶
func (*Theme) GetBlockThemeNames ¶
func (*Theme) GetParentTheme ¶
func (t *Theme) GetParentTheme() (parent types.Theme)
func (*Theme) ListFormats ¶ added in v0.1.0
func (*Theme) MatchFormat ¶
func (*Theme) NewHtmlFuncMapWithContext ¶
func (t *Theme) NewHtmlFuncMapWithContext(ctx context.Context) (fm htmlTemplate.FuncMap)
func (*Theme) NewHtmlTemplateWithContext ¶
func (*Theme) NewTextFuncMapWithContext ¶
func (t *Theme) NewTextFuncMapWithContext(ctx context.Context) (fm textTemplate.FuncMap)
func (*Theme) NewTextTemplateWithContext ¶
func (*Theme) RenderHtmlTemplateContent ¶
func (*Theme) RenderPage ¶
func (*Theme) RenderTextTemplateContent ¶
func (*Theme) TemplateFromContext ¶
Click to show internal directories.
Click to hide internal directories.