Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultModuleConfig = Config{}
Functions ¶
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 NewClient ¶
func NewClient(cfg ClientConfig) *Client
NewClient creates a new Client that can be used to manage the Hugo Components in a given workingDir. The Client will resolve the dependencies recursively, but needs the top level imports to start out.
func (*Client) Collect ¶
func (h *Client) Collect() (ModulesConfig, error)
type ClientConfig ¶
type ClientConfig struct { // Fs to get the source Fs afero.Fs // If set, it will be run before we do any duplicate checks for modules // etc. // It must be set in our case, for default project structure HookBeforeFinalize func(m *ModulesConfig) error // Absolute path to the project dir. WorkingDir string // Absolute path to the project's themes dir. ThemesDir string // Read from config file and transferred ModuleConfig Config }
ClientConfig configures the module Client.
type Config ¶
type Config struct { Mounts []Mount Imports []Import // Meta info about this module (license information etc.). Params map[string]any }
Config holds a module config.
type Import ¶
type Import struct { Path string // Module path IgnoreConfig bool // Ignore any config in config.toml (will still follow imports). IgnoreImports bool // Do not follow any configured imports. NoMounts bool // Do not mount any folder in this import. NoVendor bool // Never vendor this import (only allowed in main project). Disable bool // Turn off this module. Mounts []Mount // contains filtered or unexported fields }
type Module ¶
type Module interface { // Config The decoded module config and mounts. Config() Config // Dir Directory holding files for this module. Dir() string // IsGoMod Returns whether this is a Go Module. IsGoMod() bool // Path 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 // Owner In the dependency tree, this is the first module that defines this module // as a dependency. Owner() Module // Mounts Any directory remappings. Mounts() []Mount }
type ModulesConfig ¶
Click to show internal directories.
Click to hide internal directories.