summaryrefslogtreecommitdiffstats
path: root/docs/content/en/content-management
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-20 09:43:56 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-20 09:43:56 +0200
commite2dd4cd05fa96a08d49b3b198edf0ccf9a94970e (patch)
tree712334f7e7a657155706f556040575bea9b7757f /docs/content/en/content-management
parentfd381718101a35a5f5f92d5a05b3a0c36ef50db0 (diff)
parente509cac533600cf4fa8382c9cdab78ddd82db688 (diff)
Diffstat (limited to 'docs/content/en/content-management')
-rw-r--r--docs/content/en/content-management/archetypes.md2
-rw-r--r--docs/content/en/content-management/formats.md50
-rw-r--r--docs/content/en/content-management/image-processing/index.md8
-rw-r--r--docs/content/en/content-management/multilingual.md141
-rw-r--r--docs/content/en/content-management/shortcodes.md4
-rw-r--r--docs/content/en/content-management/syntax-highlighting.md2
-rw-r--r--docs/content/en/content-management/taxonomies.md5
7 files changed, 102 insertions, 110 deletions
diff --git a/docs/content/en/content-management/archetypes.md b/docs/content/en/content-management/archetypes.md
index d811bbac2..fe460f91f 100644
--- a/docs/content/en/content-management/archetypes.md
+++ b/docs/content/en/content-management/archetypes.md
@@ -68,7 +68,7 @@ If none of these exists, Hugo uses a built-in default archetype.
## Functions and context
-You can use any [template function] within an archetype. As shown above, the default archetype uses the [`replace`](/functions/replace/) function to replace hyphens with spaces when populating the title in front matter.
+You can use any [template function] within an archetype. As shown above, the default archetype uses the [`replace`](/functions/strings/replace) function to replace hyphens with spaces when populating the title in front matter.
Archetypes receive the following objects and values in [context]:
diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md
index f85c304cf..ccc45b943 100644
--- a/docs/content/en/content-management/formats.md
+++ b/docs/content/en/content-management/formats.md
@@ -49,7 +49,7 @@ Hugo passes reasonable default arguments to these external helpers by default:
Because additional formats are external commands, generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
{{% /note %}}
-### External helper Asciidoctor
+### Asciidoctor
The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
[See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all
@@ -59,52 +59,9 @@ optional extensions like `asciidoctor-diagram` or `asciidoctor-html5s` are insta
External `asciidoctor` command requires Hugo rendering to _disk_ to a specific destination directory. It is required to run Hugo with the command option `--destination`.
{{% /note %}}
-Some [Asciidoctor](https://asciidoctor.org/man/asciidoctor/) parameters can be customized in Hugo:
+Some Asciidoctor parameters can be customized in Hugo. See [details].
-Parameter | Comment
---- | ---
-backend | Don't change this unless you know what you are doing.
-doctype | Currently, the only document type supported in Hugo is `article`.
-extensions | Possible extensions are `asciidoctor-html5s`, `asciidoctor-bibtex`, `asciidoctor-diagram`, `asciidoctor-interdoc-reftext`, `asciidoctor-katex`, `asciidoctor-latex`, `asciidoctor-mathematical`, `asciidoctor-question`.
-attributes | Variables to be referenced in your AsciiDoc file. This is a list of variable name/value maps. See [Asciidoctor's attributes](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions).
-noHeaderOrFooter | Output an embeddable document, which excludes the header, the footer, and everything outside the body of the document. Don't change this unless you know what you are doing.
-safeMode | Safe mode level `unsafe`, `safe`, `server` or `secure`. Don't change this unless you know what you are doing.
-sectionNumbers | Auto-number section titles.
-verbose | Verbosely print processing information and configuration file checks to stderr.
-trace | Include backtrace information on errors.
-failureLevel | The minimum logging level that triggers a non-zero exit code (failure).
-
-Hugo provides additional settings that don't map directly to Asciidoctor's CLI options:
-
-workingFolderCurrent
-: Sets the working directory to be the same as that of the AsciiDoc file being processed, so that [include](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#include-files) will work with relative paths. This setting uses the `asciidoctor` cli parameter `--base-dir` and attribute `outdir=`. For rendering diagrams with [asciidoctor-diagram](https://asciidoctor.org/docs/asciidoctor-diagram/), `workingFolderCurrent` must be set to `true`.
-
-preserveTOC
-: By default, Hugo removes the table of contents generated by Asciidoctor and provides it through the built-in variable [`.TableOfContents`](/content-management/toc/) to enable further customization and better integration with the various Hugo themes. This option can be set to `true` to preserve Asciidoctor's TOC in the generated page.
-
-Below are all the AsciiDoc related settings in Hugo with their default values:
-
-{{< code-toggle config="markup.asciidocExt" />}}
-
-Notice that for security concerns only extensions that do not have path separators (either `\`, `/` or `.`) are allowed. That means that extensions can only be invoked if they are in one's ruby's `$LOAD_PATH` (ie. most likely, the extension has been installed by the user). Any extension declared relative to the website's path will not be accepted.
-
-Example of how to set extensions and attributes:
-
-```yml
-[markup.asciidocExt]
- extensions = ["asciidoctor-html5s", "asciidoctor-diagram"]
- workingFolderCurrent = true
- [markup.asciidocExt.attributes]
- my-base-url = "https://example.com/"
- my-attribute-name = "my value"
-```
-
-In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all
-parameters. Run Hugo with `-v`. You will get an output like
-
-```txt
-INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
-```
+[details]: /getting-started/configuration-markup/#asciidoc
## Learn markdown
@@ -115,7 +72,6 @@ Markdown syntax is simple enough to learn in a single sitting. The following are
* [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial]
* [The Markdown Guide, Matt Cone][mdguide]
-[`emojify` function]: /functions/emojify/
[ascii]: https://asciidoctor.org/
[config]: /getting-started/configuration/
[developer tools]: /tools/
diff --git a/docs/content/en/content-management/image-processing/index.md b/docs/content/en/content-management/image-processing/index.md
index 4af4c104d..9cce9070a 100644
--- a/docs/content/en/content-management/image-processing/index.md
+++ b/docs/content/en/content-management/image-processing/index.md
@@ -115,7 +115,7 @@ Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. U
The `Process` method is also available as a filter, which is more effective if need to apply multiple filters to an image. See [Process filter](/functions/images/#process).
{{% /note %}}
-Process processes the image with the given specification. The specification can contain an optional action, one of `resize`, `crop`, `fit` or `fill`. This means that you can use this method instead of [`Resize`], [`Fit`], [`Fill`], or [`Crop`].
+Process processes the image with the given specification. The specification can contain an optional action, one of `resize`, `crop`, `fit` or `fill`. This means that you can use this method instead of [`Resize`], [`Fit`], [`Fill`], or [`Crop`].
See [Options](#image-processing-options) for available options.
@@ -501,11 +501,11 @@ If you change image processing methods or options, or if you rename or remove im
hugo --gc
```
-[time.Format]: /functions/dateformat
+[time.Format]: /functions/time/format
[`anchor`]: /content-management/image-processing#anchor
[mounted]: /hugo-modules/configuration#module-configuration-mounts
[page bundle]: /content-management/page-bundles
-[`lang.FormatNumber`]: /functions/lang
+[`lang.FormatNumber`]: /functions/lang/formatnumber
[filters]: /functions/images
[github.com/disintegration/imaging]: <https://github.com/disintegration/imaging#image-resizing>
[Smartcrop]: <https://github.com/muesli/smartcrop#smartcrop>
@@ -519,4 +519,4 @@ hugo --gc
[`Fit`]: #fit
[`Resize`]: #resize
[site configuration]: #processing-options
-[`with`]: /functions/with/
+[`with`]: /functions/go-template/with/
diff --git a/docs/content/en/content-management/multilingual.md b/docs/content/en/content-management/multilingual.md
index ec187d663..6e787c526 100644
--- a/docs/content/en/content-management/multilingual.md
+++ b/docs/content/en/content-management/multilingual.md
@@ -468,7 +468,7 @@ English|Wednesday, November 3, 2021
Français|mercredi 3 novembre 2021
Deutsch|Mittwoch, 3. November 2021
-See [time.Format] for details.
+See [`time.Format`] for details.
### Currency
@@ -526,11 +526,86 @@ See [lang.FormatPercent] for details.
## Menus
-Localization of menu entries depends on the how you define them:
+Localization of menu entries depends on how you define them:
- When you define menu entries [automatically] using the section pages menu, you must use translation tables to localize each entry.
- When you define menu entries [in front matter], they are already localized based on the front matter itself. If the front matter values are insufficient, use translation tables to localize each entry.
-- When you define menu entries [in site configuration], you can (a) use translation tables, or (b) create language-specific menu entries under each language key.
+- When you define menu entries [in site configuration], you must create language-specific menu entries under each language key. If the names of the menu entries are insufficent, use translation tables to localize each entry.
+
+### Create language-specific menu entries
+
+#### Method 1 -- Use a single configuration file
+
+For a simple menu with a small number of entries, use a single configuration file. For example:
+
+{{< code-toggle file="hugo" copy=false >}}
+[languages.de]
+languageCode = 'de-DE'
+languageName = 'Deutsch'
+weight = 1
+
+[[languages.de.menu.main]]
+name = 'Produkte'
+pageRef = '/products'
+weight = 10
+
+[[languages.de.menu.main]]
+name = 'Leistungen'
+pageRef = '/services'
+weight = 20
+
+[languages.en]
+languageCode = 'en-US'
+languageName = 'English'
+weight = 2
+
+[[languages.en.menu.main]]
+name = 'Products'
+pageRef = '/products'
+weight = 10
+
+[[languages.en.menu.main]]
+name = 'Services'
+pageRef = '/services'
+weight = 20
+{{< /code-toggle >}}
+
+#### Method 2 -- Use a configuration directory
+
+With a more complex menu structure, create a [configuration directory] and split the menu entries into multiple files, one file per language. For example:
+
+```text
+config/
+└── _default/
+ ├── menus/
+ │ ├── menu.de.toml
+ │ └── menu.en.toml
+ └── hugo.toml
+```
+
+{{< code-toggle file="config/_default/menus/menu.de" copy=false >}}
+[[main]]
+name = 'Produkte'
+pageRef = '/products'
+weight = 10
+[[main]]
+name = 'Leistungen'
+pageRef = '/services'
+weight = 20
+{{< /code-toggle >}}
+
+{{< code-toggle file="config/_default/menus/menu.en" copy=false >}}
+[[main]]
+name = 'Products'
+pageRef = '/products'
+weight = 10
+[[main]]
+name = 'Services'
+pageRef = '/services'
+weight = 20
+{{< /code-toggle >}}
+
+[configuration directory]: /getting-started/configuration/#configuration-directory
### Use translation tables
@@ -574,44 +649,6 @@ services = 'Leistungen'
[in front matter]: /content-management/menus/#define-in-front-matter
[in site configuration]: /content-management/menus/#define-in-site-configuration
-### Create language-specific menu entries
-
-For example:
-
-{{< code-toggle file="hugo" copy=false >}}
-[languages.de]
-languageCode = 'de-DE'
-languageName = 'Deutsch'
-weight = 1
-
-[[languages.de.menu.main]]
-name = 'Produkte'
-pageRef = '/products'
-weight = 10
-
-[[languages.de.menu.main]]
-name = 'Leistungen'
-pageRef = '/services'
-weight = 20
-
-[languages.en]
-languageCode = 'en-US'
-languageName = 'English'
-weight = 2
-
-[[languages.en.menu.main]]
-name = 'Products'
-pageRef = '/products'
-weight = 10
-
-[[languages.en.menu.main]]
-name = 'Services'
-pageRef = '/services'
-weight = 20
-{{< /code-toggle >}}
-
-For a simple menu with two languages, these menu entries are easy to create and maintain. For a larger menu, or with more than two languages, using translation tables as described above is preferable.
-
## Missing translations
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
@@ -636,7 +673,7 @@ i18n|MISSING_TRANSLATION|en|wordCount
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
* Come from the built-in `.Permalink` or `.RelPermalink`
-* Be constructed with the [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR** be prefixed with `{{ .LanguagePrefix }}`
+* Be constructed with the [`relLangURL`] or [`absLangURL`] template function, or be prefixed with `{{ .LanguagePrefix }}`
If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string (and is therefore harmless for single-language Hugo websites).
@@ -657,23 +694,23 @@ hugo new content content/en/post/test.md
hugo new content content/de/post/test.md
```
-[abslangurl]: /functions/abslangurl
+[`abslangurl`]: /functions/urls/abslangurl
[config]: /getting-started/configuration/
[contenttemplate]: /templates/single-page-templates/
[go-i18n-source]: https://github.com/nicksnyder/go-i18n
[go-i18n]: https://github.com/nicksnyder/go-i18n
[homepage]: /templates/homepage/
[Hugo Multilingual Part 1: Content translation]: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/
-[i18func]: /functions/i18n/
-[lang.FormatAccounting]: /functions/lang
-[lang.FormatCurrency]: /functions/lang
-[lang.FormatNumber]: /functions/lang
-[lang.FormatNumberCustom]: /functions/lang
-[lang.FormatPercent]: /functions/lang
-[lang.Merge]: /functions/lang.merge/
+[i18func]: /functions/lang/translate
+[lang.FormatAccounting]: /functions/lang/formataccounting
+[lang.FormatCurrency]: /functions/lang/formatcurrency
+[lang.FormatNumber]: /functions/lang/formatnumber
+[lang.FormatNumberCustom]: /functions/lang/formatnumbercustom
+[lang.FormatPercent]: /functions/lang/formatpercent
+[lang.Merge]: /functions/lang/merge/
[menus]: /content-management/menus/
[OS environment]: /getting-started/configuration/#configure-with-environment-variables
-[rellangurl]: /functions/rellangurl
+[`rellangurl`]: /functions/urls/rellangurl
[RFC 5646]: https://tools.ietf.org/html/rfc5646
[single page templates]: /templates/single-page-templates/
-[time.Format]: /functions/dateformat
+[`time.Format`]: /functions/time/format
diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md
index 670c5acc8..b1e32d902 100644
--- a/docs/content/en/content-management/shortcodes.md
+++ b/docs/content/en/content-management/shortcodes.md
@@ -187,7 +187,7 @@ Rendered:
To specify one or more [highlighting options], include a quotation-encapsulated, comma-separated list:
-[highlighting options]: /functions/highlight/
+[highlighting options]: /functions/transform/highlight/
```text
{{</* highlight go-html-template "lineNos=inline, lineNoStart=42" */>}}
@@ -391,7 +391,7 @@ To learn more about creating custom shortcodes, see the [shortcode template docu
[`figure` shortcode]: #figure
[contentmanagementsection]: /content-management/formats/
[examplegist]: https://gist.github.com/spf13/7896402
-[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
+[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/
[Hugo and the GDPR]: /about/hugo-and-gdpr/
[Instagram]: https://www.instagram.com/
[pagevariables]: /variables/page/
diff --git a/docs/content/en/content-management/syntax-highlighting.md b/docs/content/en/content-management/syntax-highlighting.md
index 44dece2df..39fef0f9b 100644
--- a/docs/content/en/content-management/syntax-highlighting.md
+++ b/docs/content/en/content-management/syntax-highlighting.md
@@ -92,7 +92,7 @@ Gives this:
## Highlight template function
-See [Highlight](/functions/highlight/).
+See [Highlight](/functions/transform/highlight/).
## Highlighting in code fences
diff --git a/docs/content/en/content-management/taxonomies.md b/docs/content/en/content-management/taxonomies.md
index 14a467390..af8297876 100644
--- a/docs/content/en/content-management/taxonomies.md
+++ b/docs/content/en/content-management/taxonomies.md
@@ -191,12 +191,11 @@ title: "Bruce Willis"
wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
{{< /code-toggle >}}
-[`urlize` template function]: /functions/urlize/
[content section]: /content-management/sections/
[content type]: /content-management/types/
[documentation on archetypes]: /content-management/archetypes/
[front matter]: /content-management/front-matter/
[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-list-templates
[taxonomy templates]: /templates/taxonomy-templates/
-[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates "See how to order terms associated with a taxonomy"
-[configuration]: /getting-started/configuration/
+[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates
+[site configuration]: /getting-started/configuration/