hugo: github.com/spf13/hugo/deps Index | Files

package deps

import "github.com/spf13/hugo/deps"

Index

Package Files

deps.go

type Deps Uses

type Deps struct {
    // The logger to use.
    Log *jww.Notepad `json:"-"`

    // The templates to use. This will usually implement the full tpl.TemplateHandler.
    Tmpl tpl.TemplateFinder `json:"-"`

    // The file systems to use.
    Fs  *hugofs.Fs `json:"-"`

    // The PathSpec to use
    *helpers.PathSpec `json:"-"`

    // The ContentSpec to use
    *helpers.ContentSpec `json:"-"`

    // The configuration to use
    Cfg config.Provider `json:"-"`

    // The translation func to use
    Translate func(translationID string, args ...interface{}) string `json:"-"`

    Language *helpers.Language

    // All the output formats available for the current site.
    OutputFormatsConfig output.Formats

    WithTemplate func(templ tpl.TemplateHandler) error `json:"-"`
    // contains filtered or unexported fields
}

Deps holds dependencies used by many. There will be normally be only one instance of deps in play at a given time, i.e. one per Site built.

func New Uses

func New(cfg DepsCfg) (*Deps, error)

func (Deps) ForLanguage Uses

func (d Deps) ForLanguage(l *helpers.Language) (*Deps, error)

ForLanguage creates a copy of the Deps with the language dependent parts switched out.

func (*Deps) LoadResources Uses

func (d *Deps) LoadResources() error

func (*Deps) TemplateHandler Uses

func (d *Deps) TemplateHandler() tpl.TemplateHandler

type DepsCfg Uses

type DepsCfg struct {

    // The Logger to use.
    Logger *jww.Notepad

    // The file systems to use
    Fs  *hugofs.Fs

    // The language to use.
    Language *helpers.Language

    // The configuration to use.
    Cfg config.Provider

    // Template handling.
    TemplateProvider ResourceProvider
    WithTemplate     func(templ tpl.TemplateHandler) error

    // 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.

type ResourceProvider Uses

type ResourceProvider interface {
    Update(deps *Deps) error
    Clone(deps *Deps) error
}

ResourceProvider is used to create and refresh, and clone resources needed.

Package deps imports 9 packages (graph) and is imported by 34 packages. Updated 2017-05-22. Refresh now. Tools for package owners.