From 97a8d2963619b8ea69ce66fa75cbba7dd689ceeb Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sun, 11 Feb 2024 17:11:56 -0800 Subject: [PATCH] Document HUGO_MEMORYLIMIT Closes #2434 --- content/en/getting-started/configuration.md | 18 +++++++++++++++++- content/en/getting-started/glossary.md | 6 +++++- content/en/methods/page/Scratch.md | 6 ++++-- content/en/methods/page/Store.md | 6 ++++-- content/en/troubleshooting/faq.md | 10 +++++++--- layouts/shortcodes/eturl.html | 2 +- 6 files changed, 38 insertions(+), 10 deletions(-) diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 0741f8023..04b61685c 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -633,8 +633,24 @@ none ## Configuration environment variables +DART_SASS_BINARY +: (`string`) The absolute path to the Dart Sass executable. By default, Hugo searches for the executable in each of the paths in the `PATH` environment variable. + +HUGO_ENVIRONMENT +: (`string`) Overrides the default [environment], typically one of `development`, `staging`, or `production`. + +[environment]: /getting-started/glossary/#environment + +HUGO_FILE_LOG_FORMAT +: (`string`) A format string for the file path, line number, and column number displayed when reporting errors, or when calling the `Position` method from a shortcode or Markdown render hook. Valid tokens are `:file`, `:line`, and `:col`. Default is `:file::line::col`. + +{{< new-in 0.123.0 >}} + +HUGO_MEMORYLIMIT +: (`int`) The maximum amount of system memory, in gigabytes, that Hugo can use while rendering your site. Default is 25% of total system memory. + HUGO_NUMWORKERMULTIPLIER -: Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used. +: (`int`) The number of workers used in parallel processing. Default is the number of logical CPUs. ## Configure with environment variables diff --git a/content/en/getting-started/glossary.md b/content/en/getting-started/glossary.md index ceec3ae4f..562a3f5de 100644 --- a/content/en/getting-started/glossary.md +++ b/content/en/getting-started/glossary.md @@ -112,7 +112,7 @@ A member of a slice or array. Typically one of `development`, `staging`, or `production`, each environment may exhibit different behavior depending on configuration and template logic. For example, in a production environment you might minify and fingerprint CSS, but that probably doesn't make sense in a development environment. -When running the built-in development server with the `hugo server` command, the environment is set to `development`. When building your site with the `hugo` command, the environment is set to `production`. To override the environment value, use the `--environment` command line flag. +When running the built-in development server with the `hugo server` command, the environment is set to `development`. When building your site with the `hugo` command, the environment is set to `production`. To override the environment value, use the `--environment` command line flag or the `HUGO_ENVIRONMENT` environment variable. To determine the current environment within a template, use the [`hugo.Environment`] function. @@ -226,6 +226,10 @@ Like a [theme](#theme), a module is a packaged combination of [archetypes](#arch A class of [page kinds](#page-kind) including `home`, `section`, `taxonomy`, and `term`. +###### noop + +An abbreviated form of "no operation", a _noop_ is a statement that does nothing. + ###### object A data structure with or without associated [methods](#method). diff --git a/content/en/methods/page/Scratch.md b/content/en/methods/page/Scratch.md index 55366f405..c834b30ab 100644 --- a/content/en/methods/page/Scratch.md +++ b/content/en/methods/page/Scratch.md @@ -25,9 +25,11 @@ To create a locally scoped scratch pad that is not attached to a `Page` object, ## Determinate values -The `Scratch` method is often used to set "scratch pad" values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the "scratch pad" values are not determinate until Hugo renders the page content. +The `Scratch` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content. -If you need to access a "scratch pad" value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a noop variable: +If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable: + +[noop]: /getting-started/glossary/#noop ```go-html-template {{ $noop := .Content }} diff --git a/content/en/methods/page/Store.md b/content/en/methods/page/Store.md index 47e1cdb31..d188dbee6 100644 --- a/content/en/methods/page/Store.md +++ b/content/en/methods/page/Store.md @@ -106,9 +106,11 @@ Removes the given key. ## Determinate values -The `Store` method is often used to set "scratch pad" values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the "scratch pad" values are not determinate until Hugo renders the page content. +The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content. -If you need to access a "scratch pad" value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a noop variable: +If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable: + +[noop]: /getting-started/glossary/#noop ```go-html-template {{ $noop := .Content }} diff --git a/content/en/troubleshooting/faq.md b/content/en/troubleshooting/faq.md index c274bbd02..f8106a7db 100644 --- a/content/en/troubleshooting/faq.md +++ b/content/en/troubleshooting/faq.md @@ -102,13 +102,17 @@ In its default configuration, Hugo's file watcher may not be able detect file ch - Running Hugo locally with project files on a removable drive - Running Hugo locally with project files on a storage server accessed via the NFS, SMB, or CIFS protocols -In these cases, instead of monitoring native file system events, use the `--poll` command line flag. For example, to poll the project files every 700 milliseconds ms, use `--poll 700ms`. +In these cases, instead of monitoring native file system events, use the `--poll` command line flag. For example, to poll the project files every 700 milliseconds, use `--poll 700ms`. ###### Why is my page Scratch or Store missing a value? -The [`Scratch`] and [`Store`] methods on a `Page` object allow you to create a "scratch pad" on the given page to store and manipulate data. Values are often set within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the "scratch pad" values are not determinate until Hugo renders the page content. +The [`Scratch`] and [`Store`] methods on a `Page` object allow you to create a [scratch pad] on the given page to store and manipulate data. Values are often set within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content. -If you need to access a "scratch pad" value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a noop variable: +[scratch pad]: /getting-started/glossary/#scratch-pad + +If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable: + +[noop]: /getting-started/glossary/#noop ```go-html-template {{ $noop := .Content }} diff --git a/layouts/shortcodes/eturl.html b/layouts/shortcodes/eturl.html index e4e865d04..c0cf30aec 100644 --- a/layouts/shortcodes/eturl.html +++ b/layouts/shortcodes/eturl.html @@ -29,7 +29,7 @@ embedded_templates.toml file in the data directory. {{- errorf "The %q shortcode was unable to find a URL for the embedded template named %q. Check the name. See %s" $.Name $filename $.Position -}} {{- end -}} {{- else -}} - {{- errorf "The %q shortcode was unable to find the embedded_templates data file in the site's data directory. See %s" $.Name $.Position -}} + {{- errorf "The %q shortcode was unable to find the embedded_template_urls data file in the site's data directory. See %s" $.Name $.Position -}} {{- end -}} {{- else -}} {{- errorf "The %q shortcodes requires a named or positional parameter, the file name of the embedded template, excluding its extension. See %s" .Name .Position -}}