mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
efa74c5c6e
ac2c4a487 Update documentation for Ugly URLs (#1082) 88bdec17a Change 072.0 to 0.72.0 in release post's description 2aa7d7818 Update rss.md (#1104) c80677aeb Update quick-start.md (#1076) d04196bbd Minor spelling and capitalization fixes 837d2feba Fixed spelling mistake 67dc78e12 Update installing.md ce280c5d6 Update relurl.md bb4d0e703 Capitalization and Redirecting URL fixes e1fecada0 Update partials.md 1d99bb182 Typos and whitespacing issues fixed b20dba125 actually fix index function link this time f47d6f1e3 Fixing typos, whitespace issues and links dc82309b9 fix link to the index function 1eab0cbea add missing word (#1130) 9c3ee62ae more fixes e9bc5880a whitespace, typos and HTTPS fixes 93b806493 Add missing word to Module section 80ced9062 Display image on page bundles page. 727029b0a Update index.md 51fc48e4d Release 0.72.0 1ff68ac3b releaser: Add release notes to /docs for release of 0.72.0 f74a25b92 common/maps: Add Scratch.Values 2fd83db96 Add redirect support to the server bdfccf9f4 Fix typo in install instructions e12737ea6 Create SUPPORT.md git-subtree-dir: docs git-subtree-split: ac2c4a4871e90ddfb180f23704ce7ec9023529ca
132 lines
3.6 KiB
Markdown
132 lines
3.6 KiB
Markdown
---
|
|
title: Configure Modules
|
|
linktitle: Configure Modules
|
|
description: This page describes the configuration options for a module.
|
|
date: 2019-07-24
|
|
categories: [hugo modules]
|
|
keywords: [themes, source, organization, directories]
|
|
menu:
|
|
docs:
|
|
parent: "modules"
|
|
weight: 10
|
|
weight: 10
|
|
sections_weight: 10
|
|
toc: true
|
|
---
|
|
|
|
## Module Config: Top level
|
|
|
|
{{< code-toggle file="config">}}
|
|
[module]
|
|
proxy = "direct"
|
|
noProxy = "none"
|
|
private = "*.*"
|
|
{{< /code-toggle >}}
|
|
|
|
proxy
|
|
: Defines the proxy server to use to download remote modules. Default is `direct`, which means "git clone" and similar.
|
|
|
|
noProxy
|
|
: Comma separated glob list matching paths that should not use the proxy configured above.
|
|
|
|
private
|
|
: Comma separated glob list matching paths that should be treated as private.
|
|
|
|
Note that the above terms maps directly to their counterparts in Go Modules. Some of these setting may be natural to set as OS environment variables. To set the proxy server to use, as an example:
|
|
|
|
```
|
|
env HUGO_MODULE_PROXY=https://proxy.example.org hugo
|
|
```
|
|
|
|
{{< gomodules-info >}}
|
|
|
|
## Module Config: hugoVersion
|
|
|
|
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">}}
|
|
[module]
|
|
[module.hugoVersion]
|
|
min = ""
|
|
max = ""
|
|
extended = false
|
|
|
|
{{< /code-toggle >}}
|
|
|
|
Any of the above can be omitted.
|
|
|
|
min
|
|
: The minimum Hugo version supported, e.g. `0.55.0`
|
|
|
|
max
|
|
: The maximum Hugo version supported, e.g. `0.55.0`
|
|
|
|
extended
|
|
: Whether the extended version of Hugo is required.
|
|
|
|
## Module Config: imports
|
|
|
|
{{< code-toggle file="config">}}
|
|
[module]
|
|
[[module.imports]]
|
|
path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v"
|
|
ignoreConfig = false
|
|
disable = false
|
|
[[module.imports]]
|
|
path = "my-shortcodes"
|
|
{{< /code-toggle >}}
|
|
|
|
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.
|
|
|
|
disable
|
|
: Set to `true` to disable the module off while keeping any version info in the `go.*` files.
|
|
|
|
{{< gomodules-info >}}
|
|
|
|
|
|
## Module Config: mounts
|
|
|
|
{{% note %}}
|
|
When the `mounts` config was introduced in Hugo 0.56.0, we were careful to preserve the existing `staticDir` and similar configuration to make sure all existing sites just continued to work.
|
|
|
|
But you should not have both. So if you add a `mounts` section you should make it complete and remove the old `staticDir` etc. settings.
|
|
{{% /note %}}
|
|
|
|
{{< code-toggle file="config">}}
|
|
[module]
|
|
[[module.mounts]]
|
|
source="content"
|
|
target="content"
|
|
[[module.mounts]]
|
|
source="static"
|
|
target="static"
|
|
[[module.mounts]]
|
|
source="layouts"
|
|
target="layouts"
|
|
[[module.mounts]]
|
|
source="data"
|
|
target="data"
|
|
[[module.mounts]]
|
|
source="assets"
|
|
target="assets"
|
|
[[module.mounts]]
|
|
source="i18n"
|
|
target="i18n"
|
|
[[module.mounts]]
|
|
source="archetypes"
|
|
target="archetypes"
|
|
{{< /code-toggle >}}
|
|
|
|
source
|
|
: The source directory of the mount. For the main project, this can be either project-relative or absolute and even a symbolic link. For other modules it must be project-relative.
|
|
|
|
target
|
|
: Where it should be mounted into Hugo's virtual filesystem. It must start with one of Hugo's component folders: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, or `archetypes`. E.g. `content/blog`.
|
|
|
|
lang
|
|
: The language code, e.g. "en". Only relevant for `content` mounts, and `static` mounts when in multihost mode.
|
|
|