Merge commit 'd3927310d5b2404c3238f9b899db3329ea516490'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-27 17:02:23 +02:00
75 changed files with 214 additions and 167 deletions

View File

@@ -13,7 +13,7 @@ toc: true
## Module Config: Top level
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
[module]
noVendor = ""
proxy = "direct"
@@ -56,7 +56,7 @@ env HUGO_MODULE_PROXY=https://proxy.example.org hugo
If your module requires a particular version of Hugo to work, you can indicate that in the `module` section and the user will be warned if using a too old/new version.
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
[module]
[module.hugoVersion]
min = ""
@@ -78,7 +78,7 @@ extended
## Module Config: imports
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
[module]
[[module.imports]]
path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v"
@@ -93,7 +93,7 @@ path
: Can be either a valid Go Module module path, e.g. `github.com/gohugoio/myShortcodes`, or the directory name for the module as stored in your themes folder.
ignoreConfig
: If enabled, any module configuration file, e.g. `config.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies.
: If enabled, any module configuration file, e.g. `hugo.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies.
ignoreImports
: If enabled, module imports will not be followed.
@@ -120,7 +120,7 @@ When you add a mount, the default mount for the concerned target root is ignored
{{% /note %}}
**Default mounts**
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
[module]
[[module.mounts]]
source="content"
@@ -165,7 +165,7 @@ excludeFiles (string or slice)
: One or more glob patterns matching files to exclude.
**Example**
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
[module]
[[module.mounts]]
source="content"

View File

@@ -17,13 +17,13 @@ This section contain information that may be outdated and is in the process of b
{{% /note %}}
Since Hugo `0.42` a project can configure a theme as a composite of as many theme components you need:
{{< code-toggle file="config">}}
{{< code-toggle file="hugo" >}}
theme = ["my-shortcodes", "base-theme", "hyde"]
{{< /code-toggle >}}
You can even nest this, and have the theme component itself include theme components in its own `config.toml` (theme inheritance).[^1]
You can even nest this, and have the theme component itself include theme components in its own `hugo.toml` (theme inheritance).[^1]
The theme definition example above in `config.toml` creates a theme with 3 theme components with precedence from left to right.
The theme definition example above in `hugo.toml` creates a theme with 3 theme components with precedence from left to right.
For any given file, data entry, etc., Hugo will look first in the project and then in `my-shortcodes`, `base-theme`, and lastly `hyde`.
@@ -34,7 +34,7 @@ Hugo uses two different algorithms to merge the filesystems, depending on the fi
The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
Also note that a component that is part of a theme can have its own configuration file, e.g. `config.toml`. There are currently some restrictions to what a theme component can configure:
Also note that a component that is part of a theme can have its own configuration file, e.g. `hugo.toml`. There are currently some restrictions to what a theme component can configure:
* `params` (global and per language)
* `menu` (global and per language)

View File

@@ -33,7 +33,7 @@ The easiest way to use a Module for a theme is to import it in the config.
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
2. Import the theme:
{{< code-toggle file="config" >}}
{{< code-toggle file="hugo" >}}
[module]
[[module.imports]]
path = "github.com/spf13/hyde"