diff --git a/docs/config.toml b/docs/config.toml index 77e8770b..efa1b057 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -7,6 +7,8 @@ footnotereturnlinkcontents = "↩" languageCode = "en-us" title = "Hugo" + ignoreErrors = ["error-remote-getjson"] + googleAnalytics = "UA-7131036-4" diff --git a/docs/content/en/content-management/multilingual.md b/docs/content/en/content-management/multilingual.md index 036d7406..e24c573c 100644 --- a/docs/content/en/content-management/multilingual.md +++ b/docs/content/en/content-management/multilingual.md @@ -26,7 +26,7 @@ You should define the available languages in a `languages` section in your site The following is an example of a site configuration for a multilingual Hugo project: {{< code-toggle file="config" >}} -DefaultContentLanguage = "en" +defaultContentLanguage = "en" copyright = "Everything is mine" [params] @@ -71,7 +71,7 @@ If the default language needs to be rendered below its own language code (`/en`) Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc. -**Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `DefaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344) +**Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `defaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344) ### Disable a Language diff --git a/docs/content/en/content-management/page-bundles.md b/docs/content/en/content-management/page-bundles.md index 2ccf058e..9561ea2e 100644 --- a/docs/content/en/content-management/page-bundles.md +++ b/docs/content/en/content-management/page-bundles.md @@ -2,7 +2,6 @@ title : "Page Bundles" description : "Content organization using Page Bundles" date : 2018-01-24T13:09:00-05:00 -lastmod : 2018-01-28T22:26:40-05:00 linktitle : "Page Bundles" keywords : ["page", "bundle", "leaf", "branch"] categories : ["content management"] @@ -186,4 +185,4 @@ The hierarchy depth at which a branch bundle is created does not matter. {{% /note %}} -[^fn:1]: The `.md` extension is just an example. The extension can be `.html`, `.json` or any of any valid MIME type. +[^fn:1]: The `.md` extension is just an example. The extension can be `.html`, `.json` or any valid MIME type. diff --git a/docs/content/en/functions/with.md b/docs/content/en/functions/with.md index 3fad8bd9..a5c27d4f 100644 --- a/docs/content/en/functions/with.md +++ b/docs/content/en/functions/with.md @@ -1,7 +1,7 @@ --- title: with # linktitle: with -description: Rebinds the context (`.`) within its scope and skips the block if the variable is absent. +description: Rebinds the context (`.`) within its scope and skips the block if the variable is absent or empty. godocref: date: 2017-02-01 publishdate: 2017-02-01 @@ -18,7 +18,11 @@ relatedfuncs: [] deprecated: false --- -An alternative way of writing an `if` statement and then referencing the same value is to use `with` instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent or unset. +An alternative way of writing an `if` statement and then referencing the same value is to use `with` instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent, unset or empty. + +The set of *empty* values is defined by [the Go templates package](https://golang.org/pkg/text/template/). Empty values include `false`, the number zero, and the empty string. + +If you want to render a block if an index or key is present in a slice, array, channel or map, regardless of whether the value is empty, you should use [`isset`](/functions/isset) instead. The following example checks for a [user-defined site variable](/variables/site/) called `twitteruser`. If the key-value is not set, the following will render nothing: diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index d12ecdf3..fbfa676b 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -44,7 +44,18 @@ Multiple site config files can be specified as a comma-separated string to the ` In addition to using a single site config file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings. -- Each file represents a configuration root object, such as `Params`, `Menus`, `Languages` etc... +- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc... +- Each file's content must be top-level, for example: + + In `config.toml` is: + ```toml + [Params] + foo = "bar" + ``` + In `params.toml` is: + ``` + foo = "bar" + ``` - Each directory holds a group of files containing settings unique to an environment. - Files can be localized to become language specific. diff --git a/docs/content/en/getting-started/external-learning-resources/index.md b/docs/content/en/getting-started/external-learning-resources/index.md index 573fdfdb..349d7e29 100644 --- a/docs/content/en/getting-started/external-learning-resources/index.md +++ b/docs/content/en/getting-started/external-learning-resources/index.md @@ -26,6 +26,10 @@ Hugo in Action is a step-by-step guide to using Hugo to create static websites. [Hugo In Action Home Page](https://www.manning.com/books/hugo-in-action) +### Build Websites with Hugo + +[Build Websites with Hugo - Fast Web Development with Markdown (2020)](https://pragprog.com/titles/bhhugo/) by Brian P. Hogan. + ## Video tutorials ### Video Playlist by Mike Dane diff --git a/docs/content/en/hosting-and-deployment/hosting-on-github.md b/docs/content/en/hosting-and-deployment/hosting-on-github.md index 70803d36..55cfcccd 100644 --- a/docs/content/en/hosting-and-deployment/hosting-on-github.md +++ b/docs/content/en/hosting-and-deployment/hosting-on-github.md @@ -247,7 +247,7 @@ Refer to the [official documentation for custom domains][domains] for further in [ghsignup]: https://github.com/join [GitHub Pages service]: https://help.github.com/articles/what-is-github-pages/ [installgit]: https://git-scm.com/downloads -[orphan branch]: https://git-scm.com/docs/git-checkout/#git-checkout---orphanltnewbranchgt +[orphan branch]: https://git-scm.com/docs/git-checkout/#Documentation/git-checkout.txt---orphanltnewbranchgt [Quick Start]: /getting-started/quick-start/ [submodule]: https://github.com/blog/2104-working-with-submodules [worktree feature]: https://git-scm.com/docs/git-worktree diff --git a/docs/content/en/hosting-and-deployment/hosting-on-render.md b/docs/content/en/hosting-and-deployment/hosting-on-render.md index eb794716..f23cb42b 100644 --- a/docs/content/en/hosting-and-deployment/hosting-on-render.md +++ b/docs/content/en/hosting-and-deployment/hosting-on-render.md @@ -46,12 +46,11 @@ Static sites are **completely free** on Render and include the following: You can set up a Hugo site on Render in two quick steps: -1. Create a new **Web Service** on Render, and give Render permission to access your GitHub/Gitlab repo. +1. Create a new **Static Site** on Render, and give Render permission to access your GitHub/Gitlab repo. 2. Use the following values during creation: Field | Value ------------------- | ------------------- - **Environment** | `Static Site` **Build Command** | `hugo --gc --minify` (or your own build command) **Publish Directory** | `public` (or your own output directory) diff --git a/docs/content/en/hugo-modules/use-modules.md b/docs/content/en/hugo-modules/use-modules.md index aa03489d..db12964b 100644 --- a/docs/content/en/hugo-modules/use-modules.md +++ b/docs/content/en/hugo-modules/use-modules.md @@ -89,6 +89,7 @@ replace github.com/bep/hugotestmods/mypartials => /Users/bep/hugotestmods/mypart If you have the `hugo server` running, the configuration will be reloaded and `/Users/bep/hugotestmods/mypartials` put on the watch list. +Note that since v.0.77.0 you can use modules config [`replacements`](https://gohugo.io/hugo-modules/configuration/#module-config-top-level) option. {{< new-in "0.77.0" >}} ## Print Dependency Graph diff --git a/docs/content/en/hugo-pipes/js.md b/docs/content/en/hugo-pipes/js.md index 5e9c027d..fd869726 100644 --- a/docs/content/en/hugo-pipes/js.md +++ b/docs/content/en/hugo-pipes/js.md @@ -27,7 +27,7 @@ params [map or slice] {{< new-in "0.78.0" >}} : Params that can be imported as JSON in your JS files, e.g.: ```go-html-template -{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api" ) }} +{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }} ``` And then in your JS file: @@ -40,6 +40,9 @@ Note that this is meant for small data sets, e.g. config settings. For larger da minify [bool] : Let `js.Build` handle the minification. +avoidTDZ {{< new-in "0.78.0" >}} +: There is/was a bug in WebKit with severe performance issue with the tracking of TDZ checks in JavaScriptCore. Enabling this flag removes the TDZ and `const` assignment checks and may improve performance of larger JS codebases until the WebKit fix is in widespread use. See https://bugs.webkit.org/show_bug.cgi?id=199866 + target [string] : The language target. One of: `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020` or `esnext`. @@ -66,6 +69,8 @@ format [string] {{< new-in "0.74.3" >}} One of: `iife`, `cjs`, `esm`. Default is `iife`, a self-executing function, suitable for inclusion as a