Documentation
¶
Index ¶
- type BuildState
- type Closer
- type Closers
- type Deps
- func (d Deps) Clone(s page.Site, conf config.AllProvider) (*Deps, error)
- func (d *Deps) Close() error
- func (d *Deps) Compile(prototype *Deps) error
- func (d *Deps) Init() error
- func (e Deps) SendError(err error)
- func (d *Deps) SetTempl(t *tpl.TemplateHandlers)
- func (e Deps) StartErrorCollector() chan error
- func (e Deps) StopErrorCollector()
- func (d *Deps) TextTmpl() tpl.TemplateParseFinder
- func (d *Deps) Tmpl() tpl.TemplateHandler
- type DepsCfg
- type Listeners
- type ResourceProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildState ¶ added in v0.123.10
type BuildState struct {
// contains filtered or unexported fields
}
BuildState are state used during a build.
func (*BuildState) AddFilenameWithPostPrefix ¶ added in v0.123.10
func (b *BuildState) AddFilenameWithPostPrefix(filename string)
func (*BuildState) GetFilenamesWithPostPrefix ¶ added in v0.123.10
func (b *BuildState) GetFilenamesWithPostPrefix() []string
func (*BuildState) Incr ¶ added in v0.123.10
func (b *BuildState) Incr() int
type Deps ¶
type Deps struct {
// The logger to use.
Log loggers.Logger `json:"-"`
ExecHelper *hexec.Exec
// The file systems to use.
Fs *hugofs.Fs `json:"-"`
// The PathSpec to use
*helpers.PathSpec `json:"-"`
// The ContentSpec to use
*helpers.ContentSpec `json:"-"`
// The SourceSpec to use
SourceSpec *source.SourceSpec `json:"-"`
// The Resource Spec to use
ResourceSpec *resources.Spec
// The configuration to use
Conf config.AllProvider `json:"-"`
// The memory cache to use.
MemCache *dynacache.Cache
// The translation func to use
Translate func(ctx context.Context, translationID string, templateData any) string `json:"-"`
// The site building.
Site page.Site
TemplateProvider ResourceProvider
// Used in tests
OverloadedTemplateFuncs map[string]any
TranslationProvider ResourceProvider
Metrics metrics.Provider
// BuildStartListeners will be notified before a build starts.
BuildStartListeners *Listeners
// BuildEndListeners will be notified after a build finishes.
BuildEndListeners *Listeners
// Resources that gets closed when the build is done or the server shuts down.
BuildClosers *Closers
// This is common/global for all sites.
BuildState *BuildState
// 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 (Deps) SendError ¶ added in v0.123.10
func (e Deps) SendError(err error)
SendError sends the error on a channel to be handled later. This can be used in situations where returning and aborting the current operation isn't practical.
func (*Deps) SetTempl ¶ added in v0.123.10
func (d *Deps) SetTempl(t *tpl.TemplateHandlers)
func (Deps) StartErrorCollector ¶ added in v0.123.10
func (e Deps) StartErrorCollector() chan error
func (Deps) StopErrorCollector ¶ added in v0.123.10
func (e Deps) StopErrorCollector()
func (*Deps) TextTmpl ¶ added in v0.45.1
func (d *Deps) TextTmpl() tpl.TemplateParseFinder
func (*Deps) Tmpl ¶
func (d *Deps) Tmpl() tpl.TemplateHandler
type DepsCfg ¶
type DepsCfg struct {
// The logger to use. Only set in some tests.
// TODO(bep) get rid of this.
TestLogger loggers.Logger
// The logging level to use.
LogLevel logg.Level
// Where to write the logs.
// Currently we typically write everything to stdout.
LogOut io.Writer
// The file systems to use
Fs *hugofs.Fs
// The Site in use
Site page.Site
Configs *allconfig.Configs
// Template handling.
TemplateProvider ResourceProvider
// i18n handling.
TranslationProvider 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.