Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Set when Go modules are initialized in the current repo, that is: // a go.mod file exists. GoModulesFilename string // contains filtered or unexported fields }
Client contains most of the API provided by this package.
func (*Client) Collect ¶
func (h *Client) Collect() (ModulesConfig, error)
func (*Client) Graph ¶
TODO(bep) mod probably filter this against imports? Also check replace. TODO(bep) merge with _vendor + /theme
func (*Client) IsProbablyModule ¶
func (*Client) Vendor ¶
Like Go, Hugo supports writing the dependencies to a /vendor folder. Unlike Go, we support it for any level. We, by defaults, use the /vendor folder first, if found. To disable, run with
hugo --no-vendor TODO(bep) also on hugo mod
Given a module tree, Hugo will pick the first module for a given path, meaning that if the top-level module is vendored, that will be the full set of dependencies.
type Module ¶
type Module interface { // Optional config read from the configFilename above. Cfg() config.Provider // Optional configuration filename (e.g. "/themes/mytheme/config.json"). // This will be added to the special configuration watch list when in // server mode. ConfigFilename() string // Directory holding files for this module. Dir() string // Returns whether this is a Go Module. IsGoMod() bool // In the dependency tree, this is the first module that defines this module // as a dependency. Owner() Module // Returns the path to this module. // This will either be the module path, e.g. "github.com/gohugoio/myshortcodes", // or the path below your /theme folder, e.g. "mytheme". Path() string // Returns whether Dir points below the _vendor dir. Vendor() bool // The module version, "none" if not applicable. Version() string }
type ModuleError ¶
type ModuleError struct {
Err string // the error itself
}
type ModulesConfig ¶
Click to show internal directories.
Click to hide internal directories.