From d46f0b1d83bec8c6f263627a3336f3af5c7a39ab Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Mon, 6 Nov 2023 01:59:04 -0800 Subject: [PATCH] Miscellaneous edits --- content/en/content-management/multilingual.md | 22 ++++++++++--------- content/en/functions/js/Build.md | 4 +++- .../en/functions/partials/IncludeCached.md | 6 +++-- content/en/getting-started/configuration.md | 4 +++- content/en/hugo-pipes/js.md | 4 +++- ...next-prev-on-page-vs-next-prev-on-pages.md | 2 +- content/en/methods/page/GetTerms.md | 7 +++--- content/en/methods/page/NextInSection.md | 2 +- content/en/methods/page/PrevInSection.md | 2 +- content/en/templates/internal.md | 9 ++------ content/en/templates/output-formats.md | 4 +++- content/en/troubleshooting/faq.md | 2 +- 12 files changed, 38 insertions(+), 30 deletions(-) diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 4771b157b..aa9c44401 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -54,39 +54,39 @@ weight = 2 subtitle = 'Reference, Tutorials, and Explanations' {{< /code-toggle >}} -`defaultContentLanguage` +defaultContentLanguage : (`string`) The project's default language tag as defined by [RFC 5646]. Must be lower case, and must match one of the defined language keys. Default is `en`. Examples: - `en` - `en-gb` - `pt-br` -`defaultContentLanguageInSubdir` +defaultContentLanguageInSubdir : (`bool`) If `true`, Hugo renders the default language site in a subdirectory matching the `defaultContentLanguage`. Default is `false`. -`contentDir` +contentDir : (`string`) The content directory for this language. Omit if [translating by file name]. -`disabled` +disabled : (`bool`) If `true`, Hugo will not render content for this language. Default is `false`. -`languageCode` +languageCode : (`string`) The language tag as defined by [RFC 5646]. This value may include upper and lower case characters, hyphens or underscores, and does not affect localization or URLs. Hugo uses this value to populate the `language` element in the [built-in RSS template], and the `lang` attribute of the `html` element in the [built-in alias template]. Examples: - `en` - `en-GB` - `pt-BR` -`languageDirection` +languageDirection : (`string`) The language direction, either left-to-right (`ltr`) or right-to-left (`rtl`). Use this value in your templates with the global [`dir`] HTML attribute. -`languageName` +languageName : (`string`) The language name, typically used when rendering a language switcher. -`title` +title : (`string`) The language title. When set, this overrides the site title for this language. -`weight` +weight : (`int`) The language weight. When set to a non-zero value, this is the primary sort criteria for this language. [`dir`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir @@ -349,7 +349,9 @@ Private use subtags must not exceed 8 alphanumeric characters. ### Query basic translation -From within your templates, use the `i18n` function like this: +From within your templates, use the [`i18n`] function like this: + +[`i18n`]: /functions/lang/translate ```go-html-template {{ i18n "home" }} diff --git a/content/en/functions/js/Build.md b/content/en/functions/js/Build.md index e679dfbf7..b53a7a01f 100644 --- a/content/en/functions/js/Build.md +++ b/content/en/functions/js/Build.md @@ -162,7 +162,9 @@ Any imports in a file outside `/assets` or that does not resolve to a component The start directory for resolving npm packages (aka. packages that live inside a `node_modules` folder) is always the main project folder. -**Note:** If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project. +{{% note %}} +If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project. +{{% /note %}} ## Examples diff --git a/content/en/functions/partials/IncludeCached.md b/content/en/functions/partials/IncludeCached.md index 4067eb905..463d220fb 100644 --- a/content/en/functions/partials/IncludeCached.md +++ b/content/en/functions/partials/IncludeCached.md @@ -19,9 +19,11 @@ aliases: [/functions/partialcached] The `partialCached` template function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation. -**Note:** Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once. +{{% note %}} +Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once. -**Note**: Hugo renders pages in parallel, and will render the partial more than once with concurrent calls to the `partialCached` function. After Hugo caches the rendered partial, new pages entering the build pipeline will use the cached result. +Hugo renders pages in parallel, and will render the partial more than once with concurrent calls to the `partialCached` function. After Hugo caches the rendered partial, new pages entering the build pipeline will use the cached result. +{{% /note %}} Here is the simplest usage: diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 9768594c7..897fb9587 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -715,7 +715,9 @@ If you are using snake_cased variable names, the above will not work. Hugo deter ## Ignore content and data files when rendering -**Note:** This works, but we recommend you use the newer and more powerful [includeFiles and excludeFiles](/hugo-modules/configuration/#module-configuration-mounts) mount options. +{{% note %}} +This works, but we recommend you use the newer and more powerful [includeFiles and excludeFiles](/hugo-modules/configuration/#module-configuration-mounts) mount options. +{{% /note %}} To exclude specific files from the `content`, `data`, and `i18n` directories when rendering your site, set `ignoreFiles` to one or more regular expressions to match against the absolute file path. diff --git a/content/en/hugo-pipes/js.md b/content/en/hugo-pipes/js.md index 3934026ed..c742b2dad 100644 --- a/content/en/hugo-pipes/js.md +++ b/content/en/hugo-pipes/js.md @@ -144,7 +144,9 @@ Any imports in a file outside `/assets` or that does not resolve to a component The start directory for resolving npm packages (aka. packages that live inside a `node_modules` folder) is always the main project folder. -**Note:** If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project. +{{% note %}} +If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project. +{{% /note %}} ### Examples diff --git a/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md b/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md index cbb9f4294..4ae3a0f39 100644 --- a/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md +++ b/content/en/methods/_common/next-prev-on-page-vs-next-prev-on-pages.md @@ -29,7 +29,7 @@ With a global collection, the navigation sort order is fixed, using Hugo's defau 3. Page [linkTitle], falling back to page [title] 4. Page file path if the page is backed by a file -For example, with a global collection sorted by title, the navigation sort order will use Hugo's default sort order. This is probably not what you want or expect. For this reason, the `Next` and `Prev` methods on a `Pages` object are a generally a better choice. +For example, with a global collection sorted by title, the navigation sort order will use Hugo's default sort order. This is probably not what you want or expect. For this reason, the `Next` and `Prev` methods on a `Pages` object are generally a better choice. [date]: /methods/page/date [weight]: /methods/page/weight diff --git a/content/en/methods/page/GetTerms.md b/content/en/methods/page/GetTerms.md index 419f1fb3e..e611af491 100644 --- a/content/en/methods/page/GetTerms.md +++ b/content/en/methods/page/GetTerms.md @@ -20,11 +20,12 @@ This template code: ```go-html-template {{ with .GetTerms "tags" }} -

Tags: +

Tags

+ {{ end }} ``` diff --git a/content/en/methods/page/NextInSection.md b/content/en/methods/page/NextInSection.md index dfee353b2..b48ddcc62 100644 --- a/content/en/methods/page/NextInSection.md +++ b/content/en/methods/page/NextInSection.md @@ -63,7 +63,7 @@ With the `PrevInSection` and `NextInSection` methods, the navigation sort order 3. Page [linkTitle], falling back to page [title] 4. Page file path if the page is backed by a file -For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are a generally a better choice. +For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are generally a better choice. [date]: /methods/page/date [weight]: /methods/page/weight diff --git a/content/en/methods/page/PrevInSection.md b/content/en/methods/page/PrevInSection.md index bfbb86f3c..30b813350 100644 --- a/content/en/methods/page/PrevInSection.md +++ b/content/en/methods/page/PrevInSection.md @@ -64,7 +64,7 @@ With the `PrevInSection` and `NextInSection` methods, the navigation sort order 3. Page [linkTitle], falling back to page [title] 4. Page file path if the page is backed by a file -For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are a generally a better choice. +For example, with a page collection sorted by title, the navigation sort order will use Hugo’s default sort order. This is probably not what you want or expect. For this reason, the Next and Prev methods on a Pages object are generally a better choice. [date]: /methods/page/date [weight]: /methods/page/weight diff --git a/content/en/templates/internal.md b/content/en/templates/internal.md index 6610f6e47..ec2138bce 100644 --- a/content/en/templates/internal.md +++ b/content/en/templates/internal.md @@ -19,19 +19,14 @@ While the following internal templates are called similar to partials, they do * ## Google Analytics -Hugo ships with an internal template supporting [Google Analytics 4][GA4] (GA4). +Hugo ships with an internal template supporting [Google Analytics 4]. -**Note:** Universal Analytics are [deprecated]. - -[GA4]: https://support.google.com/analytics/answer/10089681 -[deprecated]: https://support.google.com/analytics/answer/11583528 +[Google Analytics 4]: https://support.google.com/analytics/answer/10089681 ### Configure Google Analytics Provide your tracking ID in your configuration file: -**Google Analytics 4 (gtag.js)** - {{< code-toggle file=hugo >}} [services.googleAnalytics] googleAnalytics = "G-MEASUREMENT_ID" diff --git a/content/en/templates/output-formats.md b/content/en/templates/output-formats.md index c274d256f..6aafc7734 100644 --- a/content/en/templates/output-formats.md +++ b/content/en/templates/output-formats.md @@ -53,7 +53,9 @@ The above example adds one new media type, `text/enriched`, and changes the suff mediaType = "text/html" {{}} -**Note** that for the above to work, you also need to add an `outputs` definition in your site configuration. +{{% note %}} +For the above to work, you also need to add an `outputs` definition in your site configuration. +{{% /note %}} ## Output format definitions diff --git a/content/en/troubleshooting/faq.md b/content/en/troubleshooting/faq.md index dfa55a6ec..736ed5e43 100644 --- a/content/en/troubleshooting/faq.md +++ b/content/en/troubleshooting/faq.md @@ -14,7 +14,7 @@ aliases: [/faq/] --- {{% note %}} -**Note:** The answers/solutions presented below are short, and may not be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions. +The answers/solutions presented below are short, and may not be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions. {{% /note %}} ## I can't see my content