Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct { // The logger to use. Log loggers.Logger `json:"-"` // The PathSpec to use *helpers.PathSpec `json:"-"` // All the output formats available for the current site. OutputFormatsConfig output.Formats // The Resource Spec to use ResourceSpec *resources.Spec // The SourceSpec to use SourceSpec *source.SourceSpec `json:"-"` // The ContentSpec to use *helpers.ContentSpec `json:"-"` // The site building. Site page.Site // The file systems to use. Fs *hugofs.Fs `json:"-"` // The configuration to use Cfg config.Provider `json:"-"` // The language in use. TODO(bep) consolidate with site Language *langs.Language // The translation func to use Translate func(translationID string, templateData any) string `json:"-"` // contains filtered or unexported fields }
Deps holds dependencies used by many. There will be normally only one instance of deps in play at a given time, i.e. one per Site built.
func New ¶
New initializes a Dep struct. Defaults are set for nil values, but TemplateProvider, TranslationProvider and Language are always required.
func (*Deps) LoadResources ¶
LoadResources loads translations and templates.
func (*Deps) SetTextTmpl ¶
func (d *Deps) SetTextTmpl(tmpl tpl.TemplateParseFinder)
func (*Deps) SetTmpl ¶
func (d *Deps) SetTmpl(tmpl tpl.TemplateHandler)
func (*Deps) TextTmpl ¶
func (d *Deps) TextTmpl() tpl.TemplateParseFinder
func (*Deps) Tmpl ¶
func (d *Deps) Tmpl() tpl.TemplateHandler
type DepsCfg ¶
type DepsCfg struct { // The language to use. Language *langs.Language // The file systems to use Fs *hugofs.Fs // The Site in use Site page.Site // The configuration to use. Cfg config.Provider // The media types configured. MediaTypes media.Types // The output formats configured. OutputFormats output.Formats // Template handling. TemplateProvider ResourceProvider }
DepsCfg contains configuration options that can be used to configure Hugo on a global level, i.e. logging etc. Nil values will be given default values.
Click to show internal directories.
Click to hide internal directories.