diff --git a/content/en/content-management/content-adapters.md b/content/en/content-management/content-adapters.md index 369e91a12..420d49d9d 100644 --- a/content/en/content-management/content-adapters.md +++ b/content/en/content-management/content-adapters.md @@ -11,7 +11,7 @@ weight: 290 toc: true --- -{{< new-in 0.126.0 >}} +{{< new-in 0.126.0 />}} ## Overview diff --git a/content/en/content-management/front-matter.md b/content/en/content-management/front-matter.md index dba77f1d1..9f5fc9e11 100644 --- a/content/en/content-management/front-matter.md +++ b/content/en/content-management/front-matter.md @@ -179,7 +179,7 @@ path ###### params -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} (`map`) A map of custom [page parameters]. @@ -258,7 +258,7 @@ Alias to [expirydate](#expirydate). ## Parameters -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} Specify custom page parameters under the `params` key in front matter: diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index ca2462c24..50e4b1e72 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -110,7 +110,7 @@ Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. U ### Process -{{< new-in 0.119.0 >}} +{{< new-in 0.119.0 />}} {{% note %}} The `Process` method is also available as a filter, which is more effective if you need to apply multiple filters to an image. See [Process filter](/functions/images/process). diff --git a/content/en/content-management/mathematics.md b/content/en/content-management/mathematics.md index 96d51b563..aa398d334 100644 --- a/content/en/content-management/mathematics.md +++ b/content/en/content-management/mathematics.md @@ -13,7 +13,7 @@ toc: true math: true --- -{{< new-in 0.122.0 >}} +{{< new-in 0.122.0 />}} ## Overview diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index 440398a48..84c3309cd 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -206,7 +206,7 @@ the `Name` and `Title` will be assigned to the resource files as follows: ## Multilingual -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} By default, with a multilingual single-host site, Hugo does not duplicate shared page resources when building the site. diff --git a/content/en/content-management/urls.md b/content/en/content-management/urls.md index b8cd9a01a..ab0c7148a 100644 --- a/content/en/content-management/urls.md +++ b/content/en/content-management/urls.md @@ -56,7 +56,7 @@ If you set both `slug` and `url` in front matter, the `url` value takes preceden #### Include a colon -{{< new-in 0.136.0 >}} +{{< new-in 0.136.0 />}} If you need to include a colon in the `url` front matter field, escape it with backslash characters. Use one backslash if you wrap the string within single quotes, or use two backslashes if you wrap the string within double quotes. With YAML front matter, use a single backslash if you omit quotation marks. @@ -118,7 +118,7 @@ multilingual|`about`|`https://example.org/de/about/` #### Permalinks tokens in front matter -{{< new-in "0.131.0" >}} +{{< new-in 0.131.0 />}} You can also use [tokens](#tokens) when setting the `url` value. This is typically used in `cascade` sections: diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index 23a9af7d1..16d06dee1 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -365,7 +365,7 @@ Use the `new-in` shortcode to indicate a new feature: {{}} ``` -{{< new-in 0.127.0 >}} +{{< new-in 0.127.0 />}} ### note diff --git a/content/en/functions/_common/highlighting-options.md b/content/en/functions/_common/highlighting-options.md index 363bbe6f8..2d07ccccc 100644 --- a/content/en/functions/_common/highlighting-options.md +++ b/content/en/functions/_common/highlighting-options.md @@ -45,7 +45,7 @@ tabWidth : (`int`) Substitute this number of spaces for each tab character in your highlighted code. Irrelevant if `noClasses` is `false`. Default is `4`. wrapperClass -{{< new-in 0.140.2 >}} +{{< new-in 0.140.2 />}} : (`string`) The class or classes to use for the outermost element of the highlighted code. Default is `highlight`. {{% note %}} diff --git a/content/en/functions/collections/Where.md b/content/en/functions/collections/Where.md index 381fc7cb0..014a063a1 100644 --- a/content/en/functions/collections/Where.md +++ b/content/en/functions/collections/Where.md @@ -87,7 +87,7 @@ Use any of the following logical operators: `intersect` : (`bool`) Reports whether the given field value (a slice) contains one or more elements in common with `VALUE`. See [details](/functions/collections/intersect). -`like` {{< new-in 0.116.0 >}} +`like` {{< new-in 0.116.0 />}} : (`bool`) Reports whether the given field value matches the regular expression specified in `VALUE`. Use the `like` operator to compare `string` values. The `like` operator returns `false` when comparing other data types to the regular expression. {{% note %}} @@ -168,7 +168,7 @@ For example, to return a collection of pages where any of the terms in the "genr ## Regular expression comparison -{{< new-in 0.116.0 >}} +{{< new-in 0.116.0 />}} To return a collection of pages where the "author" page parameter begins with either "victor" or "Victor": diff --git a/content/en/functions/css/PostCSS.md b/content/en/functions/css/PostCSS.md index ac911c39a..1a1a792ec 100644 --- a/content/en/functions/css/PostCSS.md +++ b/content/en/functions/css/PostCSS.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.128.0 >}} +{{< new-in 0.128.0 />}} ```go-html-template {{ with resources.Get "css/main.css" | postCSS }} diff --git a/content/en/functions/css/Sass.md b/content/en/functions/css/Sass.md index 0d5f98f8b..73f7af1ea 100644 --- a/content/en/functions/css/Sass.md +++ b/content/en/functions/css/Sass.md @@ -15,7 +15,7 @@ action: toc: true --- -{{< new-in 0.128.0 >}} +{{< new-in 0.128.0 />}} ```go-html-template {{ with resources.Get "sass/main.scss" }} @@ -92,7 +92,7 @@ includePaths ``` silenceDeprecations -: (`slice`) {{< new-in 0.139.0 >}} A slice of deprecation IDs to silence. The deprecation IDs are printed to in the warning message, e.g "import" in `WARN Dart Sass: DEPRECATED [import] ...`. This is for Dart Sass only. +: (`slice`) {{< new-in 0.139.0 />}} A slice of deprecation IDs to silence. The deprecation IDs are printed to in the warning message, e.g "import" in `WARN Dart Sass: DEPRECATED [import] ...`. This is for Dart Sass only. ## Dart Sass diff --git a/content/en/functions/css/TailwindCSS.md b/content/en/functions/css/TailwindCSS.md index 3fd727dfb..5dbab6e02 100644 --- a/content/en/functions/css/TailwindCSS.md +++ b/content/en/functions/css/TailwindCSS.md @@ -14,7 +14,7 @@ action: toc: true --- -{{< new-in 0.128.0 >}} +{{< new-in 0.128.0 />}} ## Prerequisites diff --git a/content/en/functions/debug/Timer.md b/content/en/functions/debug/Timer.md index a0704dc01..519c195c1 100644 --- a/content/en/functions/debug/Timer.md +++ b/content/en/functions/debug/Timer.md @@ -10,7 +10,7 @@ action: signatures: [debug.Timer NAME] --- -{{< new-in 0.120.0 >}} +{{< new-in 0.120.0 />}} Use the `debug.Timer` function to determine execution time for a block of code, useful for finding performance bottlenecks in templates. diff --git a/content/en/functions/fmt/Warnidf.md b/content/en/functions/fmt/Warnidf.md index cbe75816e..70c109b5b 100644 --- a/content/en/functions/fmt/Warnidf.md +++ b/content/en/functions/fmt/Warnidf.md @@ -14,7 +14,7 @@ action: aliases: [/functions/warnidf] --- -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} {{% include "functions/fmt/_common/fmt-layout.md" %}} diff --git a/content/en/functions/go-template/try.md b/content/en/functions/go-template/try.md index a78be1610..f3385a04c 100644 --- a/content/en/functions/go-template/try.md +++ b/content/en/functions/go-template/try.md @@ -11,7 +11,7 @@ action: toc: true --- -{{< new-in 0.141.0 >}} +{{< new-in 0.141.0 />}} The `try` statement is a non-standard extension to Go's [text/template] package. It introduces a mechanism for handling errors within templates, mimicking the `try-catch` constructs found in other programming languages. diff --git a/content/en/functions/hugo/IsDevelopment.md b/content/en/functions/hugo/IsDevelopment.md index 9926b67c9..bfbc0eaa1 100644 --- a/content/en/functions/hugo/IsDevelopment.md +++ b/content/en/functions/hugo/IsDevelopment.md @@ -12,7 +12,7 @@ action: signatures: [hugo.IsDevelopment] --- -{{< new-in 0.120.0 >}} +{{< new-in 0.120.0 />}} ```go-html-template {{ hugo.IsDevelopment }} → true/false diff --git a/content/en/functions/hugo/IsMultihost.md b/content/en/functions/hugo/IsMultihost.md index 2b582636b..5c1cb9f83 100644 --- a/content/en/functions/hugo/IsMultihost.md +++ b/content/en/functions/hugo/IsMultihost.md @@ -11,7 +11,7 @@ action: signatures: [hugo.IsMultihost] --- -{{< new-in v0.124.0 >}} +{{< new-in 0.124.0 />}} Site configuration: diff --git a/content/en/functions/hugo/IsMultilingual.md b/content/en/functions/hugo/IsMultilingual.md index e436ab160..91beb0d52 100644 --- a/content/en/functions/hugo/IsMultilingual.md +++ b/content/en/functions/hugo/IsMultilingual.md @@ -10,7 +10,7 @@ action: signatures: [hugo.IsMultilingual] --- -{{< new-in v0.124.0 >}} +{{< new-in 0.124.0 />}} Site configuration: diff --git a/content/en/functions/hugo/IsServer.md b/content/en/functions/hugo/IsServer.md index 942261007..0fa42fc15 100644 --- a/content/en/functions/hugo/IsServer.md +++ b/content/en/functions/hugo/IsServer.md @@ -10,7 +10,7 @@ action: signatures: [hugo.IsServer] --- -{{< new-in 0.120.0 >}} +{{< new-in 0.120.0 />}} ```go-html-template {{ hugo.IsServer }} → true/false diff --git a/content/en/functions/hugo/Store.md b/content/en/functions/hugo/Store.md index f3c43df32..4f3250954 100644 --- a/content/en/functions/hugo/Store.md +++ b/content/en/functions/hugo/Store.md @@ -14,7 +14,7 @@ action: toc: true --- -{{< new-in 0.139.0 >}} +{{< new-in 0.139.0 />}} Use the `hugo.Store` function to create a globally scoped [scratch pad](g) to store and manipulate data. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below. diff --git a/content/en/functions/images/AutoOrient.md b/content/en/functions/images/AutoOrient.md index 8f27a95d8..8e3708eea 100644 --- a/content/en/functions/images/AutoOrient.md +++ b/content/en/functions/images/AutoOrient.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.121.2 >}} +{{< new-in 0.121.2 />}} ## Usage diff --git a/content/en/functions/images/Dither.md b/content/en/functions/images/Dither.md index fd0a8368b..d6ae603a8 100644 --- a/content/en/functions/images/Dither.md +++ b/content/en/functions/images/Dither.md @@ -15,7 +15,7 @@ action: toc: true --- -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} ## Options diff --git a/content/en/functions/images/Mask.md b/content/en/functions/images/Mask.md index 4b1afcf20..8116e8946 100644 --- a/content/en/functions/images/Mask.md +++ b/content/en/functions/images/Mask.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.141.0 >}} +{{< new-in 0.141.0 />}} The `images.Mask` filter applies a mask to an image. Black pixels in the mask make the corresponding areas of the base image transparent, while white pixels keep them opaque. Color images are converted to grayscale for masking purposes. The mask is automatically resized to match the dimensions of the base image. diff --git a/content/en/functions/images/Opacity.md b/content/en/functions/images/Opacity.md index 6a74fd081..32b1bd23c 100644 --- a/content/en/functions/images/Opacity.md +++ b/content/en/functions/images/Opacity.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.119.0 >}} +{{< new-in 0.119.0 />}} The opacity value must be in the range [0, 1]. A value of `0` produces a transparent image, and a value of `1` produces an opaque image (no transparency). diff --git a/content/en/functions/images/Padding.md b/content/en/functions/images/Padding.md index 90cb6a74d..e2c2695a1 100644 --- a/content/en/functions/images/Padding.md +++ b/content/en/functions/images/Padding.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.120.0 >}} +{{< new-in 0.120.0 />}} The last argument is the canvas color, expressed as an RGB or RGBA [hexadecimal color]. The default value is `ffffffff` (opaque white). The preceding arguments are the padding values, in pixels, using the CSS [shorthand property] syntax. Negative padding values will crop the image. diff --git a/content/en/functions/images/Process.md b/content/en/functions/images/Process.md index f095a6699..959770c65 100644 --- a/content/en/functions/images/Process.md +++ b/content/en/functions/images/Process.md @@ -14,7 +14,7 @@ action: toc: true --- -{{< new-in 0.119.0 >}} +{{< new-in 0.119.0 />}} This filter has the same options as the [`Process`] method on a `Resource` object, but using it as a filter may be more effective if you need to apply multiple filters to an image. diff --git a/content/en/functions/images/QR.md b/content/en/functions/images/QR.md index 8b372e948..70a0cd5e2 100644 --- a/content/en/functions/images/QR.md +++ b/content/en/functions/images/QR.md @@ -11,7 +11,7 @@ toc: true math: true --- -{{< new-in 0.141.0 >}} +{{< new-in 0.141.0 />}} The `images.QR` function encodes the given text into a [QR code] using the specified options, returning an image resource. The size of the generated image depends on three factors: diff --git a/content/en/functions/images/Text.md b/content/en/functions/images/Text.md index 70702f841..c8d23565c 100644 --- a/content/en/functions/images/Text.md +++ b/content/en/functions/images/Text.md @@ -18,7 +18,7 @@ toc: true Although none of the options are required, at a minimum you will want to set the `size` to be some reasonable percentage of the image height. alignx - {{< new-in 0.141.0 >}} + {{< new-in 0.141.0 />}} : (`string`) The horizontal alignment of the text relative to the horizontal offset, one of `left`, `center`, or `right`. Default is `left`. color diff --git a/content/en/functions/js/_common/options.md b/content/en/functions/js/_common/options.md index 54fe7fca4..e2b6566ad 100644 --- a/content/en/functions/js/_common/options.md +++ b/content/en/functions/js/_common/options.md @@ -23,7 +23,7 @@ Note that this is meant for small data sets, e.g. configuration settings. For la ###### loaders -{{< new-in "0.140.0" >}} +{{< new-in 0.140.0 />}} (`map`) Configuring a loader for a given file type lets you load that file type with an import statement or a require call. For example configuring the .png file extension to use the data URL loader means importing a .png file gives you a data URLcontaining the contents of that image. Loaders available are `none`, `base64`, `binary`, `copy`, `css`, `dataurl`, `default`, `empty`, `file`, `global-css`, `js`, `json`, `jsx`, `local-css`, `text`, `ts`, `tsx`. See https://esbuild.github.io/api/#loader. @@ -65,7 +65,7 @@ import * as ReactDOM from 'react-dom/client'; ###### platform -{{< new-in 0.140.0 >}} +{{< new-in 0.140.0 />}} (`string`) One of `browser`, `node`, `neutral`. Default is `browser`. See https://esbuild.github.io/api/#platform. @@ -87,19 +87,19 @@ import * as ReactDOM from 'react-dom/client'; ###### sourcesContent -{{< new-in 0.140.0 >}} +{{< new-in 0.140.0 />}} (`bool`) Whether to include the content of the source files in the source map. By default, this is `true`. ###### JSX -{{< new-in 0.124.0 >}} +{{< new-in 0.124.0 />}} (`string`) How to handle/transform JSX syntax. One of: `transform`, `preserve`, `automatic`. Default is `transform`. Notably, the `automatic` transform was introduced in React 17+ and will cause the necessary JSX helper functions to be imported automatically. See https://esbuild.github.io/api/#jsx. ###### JSXImportSource -{{< new-in 0.124.0 >}} +{{< new-in 0.124.0 />}} (`string`) Which library to use to automatically import its JSX helper functions from. This only works if `JSX` is set to `automatic`. The specified library needs to be installed through npm and expose certain exports. See https://esbuild.github.io/api/#jsx-import-source. diff --git a/content/en/functions/math/Acos.md b/content/en/functions/math/Acos.md index 3ece567c8..abdae4f74 100644 --- a/content/en/functions/math/Acos.md +++ b/content/en/functions/math/Acos.md @@ -17,7 +17,7 @@ action: signatures: [math.Acos VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Acos 1 }} → 0 diff --git a/content/en/functions/math/Asin.md b/content/en/functions/math/Asin.md index d90761ae7..0496a1b45 100644 --- a/content/en/functions/math/Asin.md +++ b/content/en/functions/math/Asin.md @@ -17,7 +17,7 @@ action: signatures: [math.Asin VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Asin 1 }} → 1.5707963267948966 diff --git a/content/en/functions/math/Atan.md b/content/en/functions/math/Atan.md index dbc57d211..942b3d2f2 100644 --- a/content/en/functions/math/Atan.md +++ b/content/en/functions/math/Atan.md @@ -17,7 +17,7 @@ action: signatures: [math.Atan VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Atan 1 }} → 0.7853981633974483 diff --git a/content/en/functions/math/Atan2.md b/content/en/functions/math/Atan2.md index b78435561..efa13b166 100644 --- a/content/en/functions/math/Atan2.md +++ b/content/en/functions/math/Atan2.md @@ -17,7 +17,7 @@ action: signatures: [math.Atan2 VALUE VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Atan2 1 2 }} → 0.4636476090008061 diff --git a/content/en/functions/math/Cos.md b/content/en/functions/math/Cos.md index 847aed13a..3291b24f8 100644 --- a/content/en/functions/math/Cos.md +++ b/content/en/functions/math/Cos.md @@ -17,7 +17,7 @@ action: signatures: [math.Cos VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Cos 1 }} → 0.5403023058681398 diff --git a/content/en/functions/math/Pi.md b/content/en/functions/math/Pi.md index c5d5a01cc..f2cf92c7a 100644 --- a/content/en/functions/math/Pi.md +++ b/content/en/functions/math/Pi.md @@ -17,7 +17,7 @@ action: signatures: [math.Pi] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Pi }} → 3.141592653589793 diff --git a/content/en/functions/math/Product.md b/content/en/functions/math/Product.md index d94df4f1b..1809c560d 100644 --- a/content/en/functions/math/Product.md +++ b/content/en/functions/math/Product.md @@ -15,7 +15,7 @@ action: signatures: [math.Product VALUE...] --- -{{< new-in 0.114.0 >}} +{{< new-in 0.114.0 />}} ```go-html-template {{ math.Product 1 (slice 2 3) 4 }} → 24 diff --git a/content/en/functions/math/Rand.md b/content/en/functions/math/Rand.md index 00fcae300..cae6455c0 100644 --- a/content/en/functions/math/Rand.md +++ b/content/en/functions/math/Rand.md @@ -10,7 +10,7 @@ action: signatures: [math.Rand] --- -{{< new-in 0.121.2 >}} +{{< new-in 0.121.2 />}} The `math.Rand` function returns a pseudo-random number in the half-open [interval](g) [0.0, 1.0). diff --git a/content/en/functions/math/Sin.md b/content/en/functions/math/Sin.md index e78a5432a..37936d714 100644 --- a/content/en/functions/math/Sin.md +++ b/content/en/functions/math/Sin.md @@ -17,7 +17,7 @@ action: signatures: [math.Sin VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Sin 1 }} → 0.8414709848078965 diff --git a/content/en/functions/math/Sum.md b/content/en/functions/math/Sum.md index eba03f72d..5cf882bee 100644 --- a/content/en/functions/math/Sum.md +++ b/content/en/functions/math/Sum.md @@ -14,7 +14,7 @@ action: signatures: [math.Sum VALUE...] --- -{{< new-in 0.114.0 >}} +{{< new-in 0.114.0 />}} ```go-html-template {{ math.Sum 1 (slice 2 3) 4 }} → 10 diff --git a/content/en/functions/math/Tan.md b/content/en/functions/math/Tan.md index 3ccfa9d4e..a8691fbca 100644 --- a/content/en/functions/math/Tan.md +++ b/content/en/functions/math/Tan.md @@ -17,7 +17,7 @@ action: signatures: [math.Tan VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.Tan 1 }} → 1.557407724654902 diff --git a/content/en/functions/math/ToDegrees.md b/content/en/functions/math/ToDegrees.md index 89a7510b9..54473be72 100644 --- a/content/en/functions/math/ToDegrees.md +++ b/content/en/functions/math/ToDegrees.md @@ -12,7 +12,7 @@ action: signatures: [math.ToDegrees VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.ToDegrees 1.5707963267948966 }} → 90 diff --git a/content/en/functions/math/ToRadians.md b/content/en/functions/math/ToRadians.md index 26def5da0..c587c023c 100644 --- a/content/en/functions/math/ToRadians.md +++ b/content/en/functions/math/ToRadians.md @@ -12,7 +12,7 @@ action: signatures: [math.ToRadians VALUE] --- -{{< new-in 0.130.0 >}} +{{< new-in 0.130.0 />}} ```go-html-template {{ math.ToRadians 90 }} → 1.5707963267948966 diff --git a/content/en/functions/resources/GetRemote.md b/content/en/functions/resources/GetRemote.md index 982529077..19581c19a 100644 --- a/content/en/functions/resources/GetRemote.md +++ b/content/en/functions/resources/GetRemote.md @@ -18,6 +18,15 @@ action: toc: true --- +{{< new-in 0.141.0 >}} +The `Err` method on the returned resource was removed in v0.141.0. + +Use the [`try`] statement instead, as shown in the [error handling] example below. + +[`try`]: /functions/go-template/try +[error handling]: #error-handling +{{< /new-in >}} + ```go-html-template {{ $url := "https://example.org/images/a.jpg" }} {{ with try (resources.GetRemote $url) }} diff --git a/content/en/functions/strings/Diff/index.md b/content/en/functions/strings/Diff/index.md index da172bbeb..281b76763 100644 --- a/content/en/functions/strings/Diff/index.md +++ b/content/en/functions/strings/Diff/index.md @@ -9,7 +9,7 @@ action: signatures: [strings.Diff OLDNAME OLD NEWNAME NEW] --- -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} Use `strings.Diff` to compare two strings and render a highlighted diff: diff --git a/content/en/functions/strings/TrimSpace.md b/content/en/functions/strings/TrimSpace.md index eef4e8121..7cb293674 100644 --- a/content/en/functions/strings/TrimSpace.md +++ b/content/en/functions/strings/TrimSpace.md @@ -15,7 +15,7 @@ action: signatures: [strings.TrimSpace INPUT] --- -{{< new-in 0.136.3 >}} +{{< new-in 0.136.3 />}} Whitespace characters include `\t`, `\n`, `\v`, `\f`, `\r`, and characters in the [Unicode Space Separator] category. diff --git a/content/en/functions/templates/Defer.md b/content/en/functions/templates/Defer.md index 1d538db4a..c43ef43bf 100644 --- a/content/en/functions/templates/Defer.md +++ b/content/en/functions/templates/Defer.md @@ -12,7 +12,7 @@ action: aliases: [/functions/templates.defer] --- -{{< new-in "0.128.0" >}} +{{< new-in 0.128.0 />}} In some rare use cases, you may need to defer the execution of a template until after all sites and output formats have been rendered. One such example could be [TailwindCSS](/functions/css/tailwindcss/) using the output of [hugo_stats.json](/getting-started/configuration/#configure-build) to determine which classes and other HTML identifiers are being used in the final output: diff --git a/content/en/functions/transform/ToMath.md b/content/en/functions/transform/ToMath.md index 62d1360ce..10cd256c5 100644 --- a/content/en/functions/transform/ToMath.md +++ b/content/en/functions/transform/ToMath.md @@ -13,7 +13,7 @@ aliases: [/functions/tomath] toc: true --- -{{< new-in "0.132.0" >}} +{{< new-in 0.132.0 />}} Hugo uses an embedded instance of the [KaTeX] display engine to render mathematical markup to HTML. You do not need to install the KaTeX display engine. diff --git a/content/en/functions/transform/Unmarshal.md b/content/en/functions/transform/Unmarshal.md index 959f20223..e50fc0ee0 100644 --- a/content/en/functions/transform/Unmarshal.md +++ b/content/en/functions/transform/Unmarshal.md @@ -132,7 +132,7 @@ delimiter comment : (`string`) The comment character used in the CSV. If set, lines beginning with the comment character without preceding whitespace are ignored. -lazyQuotes {{< new-in 0.122.0 >}} +lazyQuotes {{< new-in 0.122.0 />}} : (`bool`) If true, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field. Default is `false`. ```go-html-template diff --git a/content/en/functions/transform/XMLEscape.md b/content/en/functions/transform/XMLEscape.md index d0aafc4bd..291f0f622 100644 --- a/content/en/functions/transform/XMLEscape.md +++ b/content/en/functions/transform/XMLEscape.md @@ -10,7 +10,7 @@ action: signatures: [transform.XMLEscape INPUT] --- -{{< new-in 0.121.0 >}} +{{< new-in 0.121.0 />}} The `transform.XMLEscape` function removes [disallowed characters] as defined in the XML specification, then escapes the result by replacing the following characters with [HTML entities]: diff --git a/content/en/getting-started/configuration-build.md b/content/en/getting-started/configuration-build.md index 7ee7a1461..791d4bb99 100644 --- a/content/en/getting-started/configuration-build.md +++ b/content/en/getting-started/configuration-build.md @@ -54,7 +54,7 @@ The `build.cachebusters` configuration option was added to support development u target = "$1" {{< /code-toggle >}} -When `buildStats` {{< new-in 0.115.1 >}} is enabled, Hugo writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example. +When `buildStats` {{< new-in 0.115.1 />}} is enabled, Hugo writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example. source : A regexp matching file(s) relative to one of the virtual component directories in Hugo, typically `assets/...`. @@ -66,7 +66,7 @@ target {{< code-toggle config=build.buildStats />}} -{{< new-in 0.115.1 >}} +{{< new-in 0.115.1 />}} If `enable` is set to `true`, creates a `hugo_stats.json` file in the root of your project. This file contains arrays of the `class` attributes, `id` attributes, and tags of every HTML element within your published site. Use this file as data source when [removing unused CSS] from your site. This process is also known as pruning, purging, or tree shaking. diff --git a/content/en/getting-started/configuration-markup.md b/content/en/getting-started/configuration-markup.md index f01d0dddd..ef885e44b 100644 --- a/content/en/getting-started/configuration-markup.md +++ b/content/en/getting-started/configuration-markup.md @@ -86,7 +86,7 @@ typographer|[Goldmark Extensions: Typographer]|:heavy_check_mark: #### Extras -{{< new-in 0.126.0 >}} +{{< new-in 0.126.0 />}} Enable [deleted text], [inserted text], [mark text], [subscript], and [superscript] elements in Markdown. @@ -124,7 +124,7 @@ enable = true #### Passthrough -{{< new-in 0.122.0 >}} +{{< new-in 0.122.0 />}} Enable the passthrough extension to include mathematical equations and expressions in Markdown using LaTeX markup. See [mathematics in Markdown] for details. @@ -153,7 +153,7 @@ Most of the Goldmark settings above are self-explanatory, but some require expla ###### duplicateResourceFiles -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} (`bool`) If `true`, shared page resources on multilingual single-host sites will be duplicated for each language. See [multilingual page resources] for details. Default is `false`. @@ -194,7 +194,7 @@ This is also the strategy used by the [anchorize](/functions/urls/anchorize) tem ###### renderHooks.image.enableDefault -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} (`bool`) If `true`, enables Hugo's [embedded image render hook]. Default is `false`. @@ -208,7 +208,7 @@ The embedded image render hook is automatically enabled for multilingual single- ###### renderHooks.link.enableDefault -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} (`bool`) If `true`, enables Hugo's [embedded link render hook]. Default is `false`. diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 1194121a3..23376f68f 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -232,7 +232,7 @@ See [Configure File Caches](#configure-file-caches). ###### capitalizeListTitles -{{< new-in 0.123.3 >}} +{{< new-in 0.123.3 />}} (`bool`) Whether to capitalize automatic list titles. Applicable to section, taxonomy, and term pages. Default is `true`. You can change the capitalization style in your site configuration to one of `ap`, `chicago`, `go`, `firstupper`, or `none`. See [details]. @@ -281,7 +281,7 @@ To remain consistent and prevent unexpected behavior, do not mix these strategie ###### disableDefaultLanguageRedirect -{{< new-in 0.140.0 >}} +{{< new-in 0.140.0 />}} (`bool`) Disables generation of redirect to the default language when DefaultContentLanguageInSubdir is `true`. Default is `false`. @@ -472,7 +472,7 @@ content/post/hügó.md → https://example.org/post/hugo/ ###### renderSegments -{{< new-in 0.124.0 >}} +{{< new-in 0.124.0 />}} (`[]string`) A list of segments to render. If not set, everything will be rendered. This is more commonly set in a CLI flag, e.g. `hugo --renderSegments segment1,segment2`. The segment names must match the names in the [segments](#configure-segments) configuration. @@ -563,7 +563,7 @@ enableemoji: true ## Configure page -{{< new-in 0.133.0 >}} +{{< new-in 0.133.0 />}} These methods on a `Page` object navigate to the next or previous page within a page collection, relative to the current page: @@ -734,7 +734,7 @@ HUGO_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 >}} +{{< 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. @@ -876,7 +876,7 @@ This can be set using the `cacheDir` config option or via the OS environment var If this is not set, Hugo will use, in order of preference: 1. If running on Netlify: `/opt/build/cache/hugo_cache/`. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml). -1. In a `hugo_cache` directory below the OS user cache directory as defined by Go's [os.UserCacheDir](https://pkg.go.dev/os#UserCacheDir). On Unix systems, this is `$XDG_CACHE_HOME` as specified by [basedir-spec-latest](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) if non-empty, else `$HOME/.cache`. On MacOS, this is `$HOME/Library/Caches`. On Windows, this is`%LocalAppData%`. On Plan 9, this is `$home/lib/cache`. {{< new-in 0.116.0 >}} +1. In a `hugo_cache` directory below the OS user cache directory as defined by Go's [os.UserCacheDir](https://pkg.go.dev/os#UserCacheDir). On Unix systems, this is `$XDG_CACHE_HOME` as specified by [basedir-spec-latest](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) if non-empty, else `$HOME/.cache`. On MacOS, this is `$HOME/Library/Caches`. On Windows, this is`%LocalAppData%`. On Plan 9, this is `$home/lib/cache`. {{< new-in 0.116.0 />}} 1. In a `hugo_cache_$USER` directory below the OS temp dir. If you want to know the current value of `cacheDir`, you can run `hugo config`, e.g: `hugo config | grep cachedir`. @@ -890,7 +890,7 @@ If you want to know the current value of `cacheDir`, you can run `hugo config`, ## Configure HTTP cache -{{< new-in 0.127.0 >}} +{{< new-in 0.127.0 />}} Note that this configuration is currently only relevant when using the [resources.GetRemote] function. @@ -936,7 +936,7 @@ polling ## Configure segments -{{< new-in 0.124.0 >}} +{{< new-in 0.124.0 />}} {{% note %}} The `segments` configuration is currently only used to configure partitioned rendering. diff --git a/content/en/getting-started/glossary/logical-path.md b/content/en/getting-started/glossary/logical-path.md index 3a2c96f18..e5b732cde 100644 --- a/content/en/getting-started/glossary/logical-path.md +++ b/content/en/getting-started/glossary/logical-path.md @@ -2,6 +2,6 @@ title: logical path --- -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} A page or page resource identifier derived from the file path, excluding its extension and language identifier. This value is neither a file path nor a URL. Starting with a file path relative to the `content` directory, Hugo determines the logical path by stripping the file extension and language identifier, converting to lower case, then replacing spaces with hyphens. See [examples](/methods/page/path/#examples). diff --git a/content/en/getting-started/usage.md b/content/en/getting-started/usage.md index 2e67ecb7e..3380b0ff2 100644 --- a/content/en/getting-started/usage.md +++ b/content/en/getting-started/usage.md @@ -65,7 +65,7 @@ Hugo allows you to set `draft`, `date`, `publishDate`, and `expiryDate` in the [ - The `publishDate` is in the future - The `expiryDate` is in the past -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} {{% note %}} Hugo publishes descendants of draft, future, and expired [node](g) pages. To prevent publication of these descendants, use the [`cascade`] front matter field to cascade [build options] to the descendant pages. diff --git a/content/en/hugo-modules/configuration.md b/content/en/hugo-modules/configuration.md index 13d160568..0bc1b47d8 100644 --- a/content/en/hugo-modules/configuration.md +++ b/content/en/hugo-modules/configuration.md @@ -154,7 +154,7 @@ target : (`string`) Where it should be mounted into Hugo's virtual filesystem. It must start with one of Hugo's component directories: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, or `archetypes`. E.g. `content/blog`. disableWatch -{{< new-in 0.128.0 >}} +{{< new-in 0.128.0 />}} : (`bool`) Whether to disable watching in watch mode for this mount. Default is `false`. lang diff --git a/content/en/methods/page/ContentWithoutSummary.md b/content/en/methods/page/ContentWithoutSummary.md index 44d660cef..527f5d962 100644 --- a/content/en/methods/page/ContentWithoutSummary.md +++ b/content/en/methods/page/ContentWithoutSummary.md @@ -15,7 +15,7 @@ action: signatures: [PAGE.ContentWithoutSummary] --- -{{< new-in 0.134.0 >}} +{{< new-in 0.134.0 />}} Applicable when using manual or automatic [content summaries], the `ContentWithoutSummary` method on a `Page` object renders Markdown and shortcodes to HTML, excluding the content summary from the result. diff --git a/content/en/methods/page/File.md b/content/en/methods/page/File.md index 3b136f918..359c1ad2e 100644 --- a/content/en/methods/page/File.md +++ b/content/en/methods/page/File.md @@ -84,7 +84,7 @@ The path separators (slash or backslash) in `Path`, `Dir`, and `Filename` depend ###### IsContentAdapter -{{< new-in 0.126.0 >}} +{{< new-in 0.126.0 />}} (`bool`) Reports whether the file is a [content adapter]. diff --git a/content/en/methods/page/Path.md b/content/en/methods/page/Path.md index 657410112..83ad01b94 100644 --- a/content/en/methods/page/Path.md +++ b/content/en/methods/page/Path.md @@ -12,7 +12,7 @@ action: toc: true --- -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} The `Path` method on a `Page` object returns the [logical path](g) of the given page, regardless of whether the page is backed by a file. diff --git a/content/en/methods/page/RenderShortcodes.md b/content/en/methods/page/RenderShortcodes.md index 319edea69..3346f0ba1 100644 --- a/content/en/methods/page/RenderShortcodes.md +++ b/content/en/methods/page/RenderShortcodes.md @@ -17,7 +17,7 @@ action: toc: true --- -{{< new-in 0.117.0 >}} +{{< new-in 0.117.0 />}} Use this method in shortcode templates to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents. diff --git a/content/en/methods/page/Resources.md b/content/en/methods/page/Resources.md index 2495ca8df..6c79f58ee 100644 --- a/content/en/methods/page/Resources.md +++ b/content/en/methods/page/Resources.md @@ -71,7 +71,7 @@ When working with global resources instead of page resources, use the [`resource ###### Mount -{{< new-in "0.140.0" >}} +{{< new-in 0.140.0 />}} (`ResourceGetter`) Mounts the given resources from the two arguments base (`string`) to the given target path (`string`) and returns an object that implements [Get](#get). Note that leading slashes in target marks an absolute path. Relative target paths allows you to mount resources relative to another set, e.g. a [Page bundle](/content-management/page-bundles/): diff --git a/content/en/methods/page/Sitemap.md b/content/en/methods/page/Sitemap.md index 0472b26a6..065c07c35 100644 --- a/content/en/methods/page/Sitemap.md +++ b/content/en/methods/page/Sitemap.md @@ -21,7 +21,7 @@ changefreq {{ .Sitemap.ChangeFreq }} ``` -disable {{< new-in 0.125.0 >}} +disable {{< new-in 0.125.0 />}} : (`bool`) Whether to disable page inclusion. Default is `false`. Set to `true` in front matter to exclude the page. ```go-html-template diff --git a/content/en/methods/pager/PagerSize.md b/content/en/methods/pager/PagerSize.md index 623548398..5f5f7d3a8 100644 --- a/content/en/methods/pager/PagerSize.md +++ b/content/en/methods/pager/PagerSize.md @@ -10,7 +10,7 @@ action: signatures: [PAGER.PagerSize] --- -{{< new-in 0.128.0 >}} +{{< new-in 0.128.0 />}} The number of pages per pager is determined by the optional second argument passed to the [`Paginate`] method, falling back to the `pagerSize` as defined in your [site configuration]. diff --git a/content/en/methods/resource/Colors.md b/content/en/methods/resource/Colors.md index 73fe1e7ae..08f63ae3f 100644 --- a/content/en/methods/resource/Colors.md +++ b/content/en/methods/resource/Colors.md @@ -20,11 +20,11 @@ The `Resources.Colors` method returns a slice of the most dominant colors in an Each color is an object with the following methods: ColorHex -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`string`) Returns the [hexadecimal color] value, prefixed with a hash sign. Luminance -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`float64`) Returns the [relative luminance] of the color in the sRGB colorspace in the range [0, 1]. A value of `0` represents the darkest black, while a value of `1` represents the lightest white. {{% note %}} diff --git a/content/en/methods/shortcode/Store.md b/content/en/methods/shortcode/Store.md index 3e350c01a..8d9a8596b 100644 --- a/content/en/methods/shortcode/Store.md +++ b/content/en/methods/shortcode/Store.md @@ -14,7 +14,7 @@ action: toc: true --- -{{< new-in 0.139.0 >}} +{{< new-in 0.139.0 />}} Use the `Store` method to create a [scratch pad](g) to store and manipulate data, scoped to the current shortcode. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below. diff --git a/content/en/methods/site/Lastmod.md b/content/en/methods/site/Lastmod.md index 081481956..f1663db49 100644 --- a/content/en/methods/site/Lastmod.md +++ b/content/en/methods/site/Lastmod.md @@ -9,7 +9,7 @@ action: signatures: [SITE.Lastmod] --- -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} The `Lastmod` method on a `Site` object returns a [`time.Time`] value. Use this with time [functions] and [methods]. For example: diff --git a/content/en/methods/site/Store.md b/content/en/methods/site/Store.md index 92433c829..dcc3a0bed 100644 --- a/content/en/methods/site/Store.md +++ b/content/en/methods/site/Store.md @@ -13,7 +13,7 @@ action: toc: true --- -{{< new-in 0.139.0 >}} +{{< new-in 0.139.0 />}} Use the `Store` method on a `Site` object to create a [scratch pad](g) to store and manipulate data, scoped to the current site. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below. diff --git a/content/en/methods/taxonomy/Page.md b/content/en/methods/taxonomy/Page.md index e148ac5c7..039719b93 100644 --- a/content/en/methods/taxonomy/Page.md +++ b/content/en/methods/taxonomy/Page.md @@ -9,7 +9,7 @@ action: signatures: [TAXONOMY.Page] --- -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} This `TAXONOMY` method returns nil if the taxonomy has no terms, so you must code defensively: diff --git a/content/en/render-hooks/_common/pageinner.md b/content/en/render-hooks/_common/pageinner.md index 92bd63c56..6f2622880 100644 --- a/content/en/render-hooks/_common/pageinner.md +++ b/content/en/render-hooks/_common/pageinner.md @@ -4,7 +4,7 @@ _comment: Do not remove front matter. ## PageInner details -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} The primary use case for `PageInner` is to resolve links and [page resources](g) relative to an included `Page`. For example, create an "include" shortcode to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents: diff --git a/content/en/render-hooks/blockquotes.md b/content/en/render-hooks/blockquotes.md index b0fee7239..bdeb06af9 100755 --- a/content/en/render-hooks/blockquotes.md +++ b/content/en/render-hooks/blockquotes.md @@ -12,7 +12,7 @@ weight: 30 toc: true --- -{{< new-in 0.132.0 >}} +{{< new-in 0.132.0 />}} ## Context @@ -24,13 +24,13 @@ Blockquote render hook templates receive the following [context](g): ###### AlertTitle -{{< new-in 0.134.0 >}} +{{< new-in 0.134.0 />}} (`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below. ###### AlertSign -{{< new-in 0.134.0 >}} +{{< new-in 0.134.0 />}} (`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of `+`, `-`, or an empty string. See the [alerts](#alerts) section below. diff --git a/content/en/render-hooks/code-blocks.md b/content/en/render-hooks/code-blocks.md index 5022fd3ae..7999dbeb8 100755 --- a/content/en/render-hooks/code-blocks.md +++ b/content/en/render-hooks/code-blocks.md @@ -78,7 +78,7 @@ Code block render hook templates receive the following [context](g): ###### PageInner -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details). diff --git a/content/en/render-hooks/headings.md b/content/en/render-hooks/headings.md index 2b32797cc..7c9d6b6fe 100755 --- a/content/en/render-hooks/headings.md +++ b/content/en/render-hooks/headings.md @@ -41,7 +41,7 @@ title = true ###### PageInner -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details). diff --git a/content/en/render-hooks/images.md b/content/en/render-hooks/images.md index 900df3c2f..63f294081 100755 --- a/content/en/render-hooks/images.md +++ b/content/en/render-hooks/images.md @@ -59,7 +59,7 @@ block = true ###### PageInner -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details). @@ -122,7 +122,7 @@ wrapStandAloneImageWithinParagraph = false ## Default -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} Hugo includes an [embedded image render hook] to resolve Markdown image destinations. Disabled by default, you can enable it in your site configuration: diff --git a/content/en/render-hooks/links.md b/content/en/render-hooks/links.md index 7700a540e..89044c662 100755 --- a/content/en/render-hooks/links.md +++ b/content/en/render-hooks/links.md @@ -38,7 +38,7 @@ Link render hook templates receive the following context: ###### PageInner -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details). @@ -90,7 +90,7 @@ To include a `rel` attribute set to `external` for external links: ## Default -{{< new-in 0.123.0 >}} +{{< new-in 0.123.0 />}} Hugo includes an [embedded link render hook] to resolve Markdown link destinations. Disabled by default, you can enable it in your site configuration: diff --git a/content/en/render-hooks/passthrough.md b/content/en/render-hooks/passthrough.md index 95bc54d88..798225061 100755 --- a/content/en/render-hooks/passthrough.md +++ b/content/en/render-hooks/passthrough.md @@ -12,7 +12,7 @@ weight: 80 toc: true --- -{{< new-in 0.132.0 >}} +{{< new-in 0.132.0 />}} ## Overview diff --git a/content/en/render-hooks/tables.md b/content/en/render-hooks/tables.md index 4252d6de0..d131664fc 100755 --- a/content/en/render-hooks/tables.md +++ b/content/en/render-hooks/tables.md @@ -12,7 +12,7 @@ weight: 90 toc: true --- -{{< new-in 0.134.0 >}} +{{< new-in 0.134.0 />}} ## Context diff --git a/content/en/shortcodes/comment.md b/content/en/shortcodes/comment.md index 208277bf5..ed810efd0 100755 --- a/content/en/shortcodes/comment.md +++ b/content/en/shortcodes/comment.md @@ -18,7 +18,7 @@ To override Hugo's embedded `comment` shortcode, copy the [source code] to a fil [source code]: {{% eturl comment %}} {{% /note %}} -{{< new-in "0.137.1" >}} +{{< new-in 0.137.1 />}} Use the `comment` shortcode to include comments in your content. Hugo will ignore the text within these comments when rendering your site. diff --git a/content/en/shortcodes/details.md b/content/en/shortcodes/details.md index f6e5ae691..f30f81d75 100755 --- a/content/en/shortcodes/details.md +++ b/content/en/shortcodes/details.md @@ -11,7 +11,7 @@ weight: toc: true --- -{{< new-in 0.140.0 >}} +{{< new-in 0.140.0 />}} {{% note %}} To override Hugo's embedded `details` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory. diff --git a/content/en/shortcodes/qr.md b/content/en/shortcodes/qr.md index 15e06cbc3..6208c6998 100755 --- a/content/en/shortcodes/qr.md +++ b/content/en/shortcodes/qr.md @@ -11,7 +11,7 @@ weight: toc: true --- -{{< new-in 0.141.0 >}} +{{< new-in 0.141.0 />}} {{% note %}} To override Hugo's embedded `qr` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory. diff --git a/content/en/shortcodes/x.md b/content/en/shortcodes/x.md index 6995d727f..e27bc996a 100755 --- a/content/en/shortcodes/x.md +++ b/content/en/shortcodes/x.md @@ -11,7 +11,7 @@ weight: toc: true --- -{{< new-in 0.141.0 >}} +{{< new-in 0.141.0 />}} {{% note %}} To override Hugo's embedded `x` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory. diff --git a/content/en/shortcodes/youtube.md b/content/en/shortcodes/youtube.md index 51e47a0c9..546529500 100755 --- a/content/en/shortcodes/youtube.md +++ b/content/en/shortcodes/youtube.md @@ -41,38 +41,38 @@ id : (`string`) The video `id`. Optional if the `id` is provided as a positional argument as shown in the example above. allowFullScreen -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`bool`) Whether the `iframe` element can activate full screen mode. Default is `true`. autoplay - {{< new-in 0.125.0 >}} + {{< new-in 0.125.0 />}} : (`bool`) Whether to automatically play the video. Forces `mute` to `true`. Default is `false`. class : (`string`) The `class` attribute of the wrapping `div` element. When specified, removes the `style` attributes from the `iframe` element and its wrapping `div` element. controls -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`bool`) Whether to display the video controls. Default is `true`. end -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`int`) The time, measured in seconds from the start of the video, when the player should stop playing the video. loading -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`string`) The loading attribute of the `iframe` element, either `eager` or `lazy`. Default is `eager`. loop -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`bool`) Whether to indefinitely repeat the video. Ignores the `start` and `end` arguments after the first play. Default is `false`. mute -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`bool`) Whether to mute the video. Always `true` when `autoplay` is `true`. Default is `false`. start -{{< new-in 0.125.0 >}} +{{< new-in 0.125.0 />}} : (`int`) The time, measured in seconds from the start of the video, when the player should start playing the video. title diff --git a/content/en/templates/sitemap.md b/content/en/templates/sitemap.md index 8ef00269d..b21372040 100644 --- a/content/en/templates/sitemap.md +++ b/content/en/templates/sitemap.md @@ -35,7 +35,7 @@ These are the default sitemap configuration values. They apply to all pages unle changefreq : (`string`) How frequently a page is likely to change. Valid values are `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, and `never`. With the default value of `""` Hugo will omit this field from the sitemap. See [details](https://www.sitemaps.org/protocol.html#changefreqdef). -disable {{< new-in 0.125.0 >}} +disable {{< new-in 0.125.0 />}} : (`bool`) Whether to disable page inclusion. Default is `false`. Set to `true` in front matter to exclude the page. filename diff --git a/layouts/shortcodes/new-in.html b/layouts/shortcodes/new-in.html new file mode 100644 index 000000000..c725ae14b --- /dev/null +++ b/layouts/shortcodes/new-in.html @@ -0,0 +1,51 @@ +{{- /* +Renders a "new in" button indicating the version in which a feature was added. + +When comparing the current version to the specified version, the "new in" +button will be hidden if any of the following conditions is true: + +- The major version difference exceeds the majorVersionDiffThreshold +- The minor version difference exceeds the minorVersionDiffThreshold + +@param {string} version The semantic version string, with or without a leading v. +@returns {template.HTML} + +@examples {{< new-in 0.100.0 />}} + + {{< new-in 0.100.0 >}} + Some descriptive text here. + {{< /new-in >}} +*/}} + + +{{ $_hugo_config := `{ "version": 1 }` }} + +{{- /* Set defaults. */}} +{{- $majorVersionDiffThreshold := 0 }} +{{- $minorVersionDiffThreshold := 30 }} +{{- $displayExpirationWarning := true }} + +{{- /* Render. */}} +{{- with $version := .Get 0 | strings.TrimPrefix "v" }} + {{- $majorVersionDiff := sub (index (split hugo.Version ".") 0 | int) (index (split $version ".") 0 | int) }} + {{- $minorVersionDiff := sub (index (split hugo.Version ".") 1 | int) (index (split $version ".") 1 | int) }} + {{- if or (gt $majorVersionDiff $majorVersionDiffThreshold) (gt $minorVersionDiff $minorVersionDiffThreshold) }} + {{- if $displayExpirationWarning }} + {{- warnf "This call to the %q shortcode should be removed: %s. The button is now hidden because the specified version (%s) is older than the display threshold." $.Name $.Position $version }} + {{- end }} + {{- else }} + {{- $href := printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }} + {{- with $.Inner }} + + {{- else }} + New in v{{ $version }} + {{- end }} + {{- end }} +{{- else }} + {{- errorf "The %q shortcode requires a positional parameter (version). See %s" .Name .Position }} +{{- end -}}