From 0f0ab2adeefc8449e0347ec5ffcfa8abf83469f3 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 11 Nov 2023 11:58:03 -0800 Subject: [PATCH] Add methods deprecated in v0.120.0 Closes #2323 --- content/en/content-management/diagrams.md | 2 +- .../image-processing/index.md | 4 +- content/en/content-management/multilingual.md | 2 +- content/en/content-management/related.md | 8 +- .../content-management/syntax-highlighting.md | 2 +- content/en/contribute/documentation.md | 86 +++++++++++++++---- content/en/functions/debug/Timer.md | 2 +- content/en/functions/hugo/IsDevelopment.md | 2 + content/en/functions/hugo/IsServer.md | 2 + content/en/functions/images/Padding.md | 2 + content/en/getting-started/configuration.md | 16 ++-- content/en/hugo-modules/use-modules.md | 2 +- content/en/hugo-pipes/postcss.md | 2 +- content/en/hugo-pipes/postprocess.md | 2 +- .../en/hugo-pipes/transpile-sass-to-css.md | 4 +- content/en/methods/site/DisqusShortname.md | 20 +++++ content/en/methods/site/GoogleAnalytics.md | 20 +++++ content/en/methods/site/IsDevelopment.md | 20 +++++ content/en/methods/site/IsServer.md | 20 +++++ content/en/templates/render-hooks.md | 8 +- content/en/troubleshooting/deprecation.md | 3 +- layouts/shortcodes/deprecated-in.html | 14 +++ layouts/shortcodes/new-in.html | 13 +++ layouts/shortcodes/note.html | 7 ++ 24 files changed, 216 insertions(+), 47 deletions(-) create mode 100644 content/en/methods/site/DisqusShortname.md create mode 100644 content/en/methods/site/GoogleAnalytics.md create mode 100644 content/en/methods/site/IsDevelopment.md create mode 100644 content/en/methods/site/IsServer.md create mode 100644 layouts/shortcodes/deprecated-in.html create mode 100644 layouts/shortcodes/new-in.html create mode 100644 layouts/shortcodes/note.html diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index c6cef74359..47da32bda9 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -10,7 +10,7 @@ menu: weight: 50 toc: true --- -{{< new-in "0.93.0" >}} +{{< new-in 0.93.0 >}} ## GoAT diagrams (Ascii) diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 82d90b1bb6..5113657000 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). @@ -205,7 +205,7 @@ Sometimes it can be useful to create the filter chain once and then reuse it. ### Colors -{{< new-in "0.104.0" >}} +{{< new-in 0.104.0 >}} `.Colors` returns a slice of hex strings with the dominant colors in the image using a simple histogram method. diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 329945b2ad..4fdd3df300 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -97,7 +97,7 @@ weight ### Changes in Hugo 0.112.0 -{{< new-in "0.112.0" >}} +{{< new-in 0.112.0 >}} In Hugo `v0.112.0` we consolidated all configuration options, and improved how the languages and their parameters are merged with the main configuration. But while testing this on Hugo sites out there, we received some error reports and reverted some of the changes in favor of deprecation warnings: diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 87efeed9be..526a080f1e 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -65,7 +65,7 @@ We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 di ## Index content headings in related content -{{< new-in "0.111.0" >}} +{{< new-in 0.111.0 >}} Hugo can index the headings in your content and use this to find related content. You can enable this by adding a index of type `fragments` to your `related` configuration: @@ -140,16 +140,16 @@ toLower name : (`string`) The index name. This value maps directly to a page parameter. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects. -type {{< new-in "0.111.0" >}} +type {{< new-in 0.111.0 >}} : (`string`) One of `basic`(default) or `fragments`. -applyFilter {{< new-in "0.111.0" >}} +applyFilter {{< new-in 0.111.0 >}} : (`string`) Apply a `type` specific filter to the result of a search. This is currently only used for the `fragments` type. weight : (`int`) An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be `0`, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best. -cardinalityThreshold {{< new-in "0.111.0" >}} +cardinalityThreshold {{< new-in 0.111.0 >}} : (`int`) A percentage (0-100) used to remove common keywords from the index. As an example, setting this to `50` will remove all keywords that are used in more than 50% of the documents in the index. Default is `0`. pattern diff --git a/content/en/content-management/syntax-highlighting.md b/content/en/content-management/syntax-highlighting.md index 401faf41f0..62071cd465 100644 --- a/content/en/content-management/syntax-highlighting.md +++ b/content/en/content-management/syntax-highlighting.md @@ -41,7 +41,7 @@ Options: * `linenostart=199`: starts the line number count from 199. * `anchorlinenos`: Configure anchors on line numbers. Valid values are `true` or `false`; * `lineanchors`: Configure a prefix for the anchors on line numbers. Will be suffixed with `-`, so linking to the line number 1 with the option `lineanchors=prefix` adds the anchor `prefix-1` to the page. -* `hl_inline` Highlight inside a `` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`. {{< new-in "0.101.0" >}} +* `hl_inline` Highlight inside a `` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`. {{< new-in 0.101.0 >}} ### Example: highlight shortcode diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index 1f0d8dfca4..79719e3025 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -196,9 +196,55 @@ Rendered: These shortcodes are commonly used throughout the documentation. Other shortcodes are available for specialized use. +### deprecated-in + +Use the “deprecated-in” shortcode to indicate that a feature is deprecated: + +```text +{{%/* deprecated-in 0.120.0 */%}} +Use [`hugo.IsServer`] instead. + +[`hugo.IsServer`]: /functions/hugo/isserver +{{%/* /deprecated-in */%}} +``` + +Rendered: + +{{% deprecated-in 0.120.0 %}} +Use [`hugo.IsServer`] instead. + +[`hugo.IsServer`]: /functions/hugo/isserver +{{% /deprecated-in %}} + +### code + +Use the "code" shortcode for other code examples that require a file name. See the [code examples] above. This shortcode takes these arguments: + +copy +: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. + +file +: (`string`) The file name to display. + +lang +: (`string`) The code language. If you do not provide a `lang` argument, the code language is determined by the file extension. If the file extension is "html", sets the code language to `go-html-template`. Default is `text`. + +### code-toggle + +Use the "code-toggle" shortcode to display examples of site configuration, front matter, or data files. See the [code examples] above. This shortcode takes these arguments: + +copy +: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. + +file +: (`string`) The file name to display. Omit the file extension for site configuration examples. + +fm +: (`bool`) Whether the example is front matter. Default is `false`. + ### new-in -Use the "new-in" shortcode to indicate a new feature. +Use the "new-in" shortcode to indicate a new feature: ```text {{}} @@ -228,31 +274,37 @@ Use the [`math.Mod`] function to control... [`math.Mod`]: /functions/math/mod/ {{% /code %}} -### code-toggle +## New features -Use the "code-toggle" shortcode to display examples of site configuration, front matter, or data files. See the [code examples] above. This shortcode takes these arguments: +Use the "new-in" shortcode to indicate a new feature: -copy -: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. +{{< code file=content/something/foo.md lang=text >}} +{{}} +{{< /code >}} -file -: (`string`) The file name to display. Omit the file extension for site configuration examples. +## Deprecated features -fm -: (`bool`) Whether the example is front matter. Default is `false`. +Use the "deprecated-in" shortcode to indicate that a feature is deprecated: -### code +{{< code file=content/something/foo.md >}} +{{%/* deprecated-in 0.120.0 */%}} +Use [`hugo.IsServer`] instead. -Use the "code" shortcode for other code examples that require a file name. See the [code examples] above. This shortcode takes these arguments: +[`hugo.IsServer`]: /functions/hugo/isserver +{{%/* /deprecated-in */%}} +{{< /code >}} -copy -: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. +When deprecating a function or method, add this to front matter: -file -: (`string`) The file name to display. +{{< code-toggle file=content/something/foo.md fm=true >}} +expiryDate: 2024-10-30 +_build: + list: never +{{< /code-toggle >}} -lang -: (`string`) The code language. If you do not provide a `lang` argument, the code language is determined by the file extension. If the file extension is "html", sets the code language to `go-html-template`. Default is `text`. +Set the `exipiryDate` to one year from the date of deprecation, and add a brief front matter comment to explain the settings. + +Users will be able to search for the page, but the page will not appear in any list views, including section menus. ## GitHub workflow diff --git a/content/en/functions/debug/Timer.md b/content/en/functions/debug/Timer.md index 3e3af0a0c9..ae6c3188fd 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 bottle necks in templates. diff --git a/content/en/functions/hugo/IsDevelopment.md b/content/en/functions/hugo/IsDevelopment.md index 361378b2f9..1db33a7aad 100644 --- a/content/en/functions/hugo/IsDevelopment.md +++ b/content/en/functions/hugo/IsDevelopment.md @@ -10,6 +10,8 @@ action: signatures: [hugo.IsDevelopment] --- +{{< new-in 0.120.0 >}} + ```go-html-template {{ hugo.IsDevelopment }} → true/false ``` diff --git a/content/en/functions/hugo/IsServer.md b/content/en/functions/hugo/IsServer.md index add88b8eb7..9422610078 100644 --- a/content/en/functions/hugo/IsServer.md +++ b/content/en/functions/hugo/IsServer.md @@ -10,6 +10,8 @@ action: signatures: [hugo.IsServer] --- +{{< new-in 0.120.0 >}} + ```go-html-template {{ hugo.IsServer }} → true/false ``` diff --git a/content/en/functions/images/Padding.md b/content/en/functions/images/Padding.md index 1362bc78eb..1396265962 100644 --- a/content/en/functions/images/Padding.md +++ b/content/en/functions/images/Padding.md @@ -13,6 +13,8 @@ action: toc: true --- +{{< 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. [hexadecimal color]: https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index d80a7e1fbf..de9b833de3 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -35,7 +35,7 @@ Multiple site configuration files can be specified as a comma-separated string t In Hugo 0.110.0 we changed the default configuration base file name to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier for code editors and build tools to identify this as a Hugo configuration file and project. -{{< new-in "0.110.0" >}} +{{< new-in 0.110.0 >}} ## Configuration directory @@ -190,12 +190,10 @@ See [Configure File Caches](#configure-file-caches) ### cascade -Pass down down default configuration values (front matter) to pages in the content tree. -The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade). +Pass down down default configuration values (front matter) to pages in the content tree. The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade). {{% note %}} -For a website in a single language, define the `[[cascade]]` in [Front Matter](/content-management/front-matter#front-matter-cascade). -For a multilingual website, define the `[[cascade]]` in [Site Config](../../getting-started/configuration/#cascade). +For a website in a single language, define the `[[cascade]]` in [Front Matter](/content-management/front-matter#front-matter-cascade). For a multilingual website, define the `[[cascade]]` in [Site Config](../../getting-started/configuration/#cascade). To remain consistent and prevent unexpected behaviour, do not mix these strategies. {{% /note %}} @@ -523,7 +521,7 @@ The `build` configuration section contains global build-related configuration op {{< code-toggle config=build />}} -buildStats {{< new-in "0.115.1" >}} +buildStats {{< new-in 0.115.1 >}} : When enabled, 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. [removing unused CSS]: /hugo-pipes/postprocess/#css-purging-with-postcss @@ -553,7 +551,7 @@ useResourceCacheWhen ## Configure cache busters -{{< new-in "0.112.0" >}} +{{< new-in 0.112.0 >}} The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` configuration may look like this: @@ -630,7 +628,7 @@ Setting `force=true` will make a redirect even if there is existing content in t ## 404 server error page {#_404-server-error-page} -{{< new-in "0.103.0" >}} +{{< new-in 0.103.0 >}} Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [server configuration](#configure-server), you need to add the 404 redirect explicitly, e.g: @@ -851,7 +849,7 @@ This can be set using the `cacheDir` config option or via the OS env variable `H 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`. diff --git a/content/en/hugo-modules/use-modules.md b/content/en/hugo-modules/use-modules.md index 348d3d3c6c..9e8f1d4d0d 100644 --- a/content/en/hugo-modules/use-modules.md +++ b/content/en/hugo-modules/use-modules.md @@ -133,7 +133,7 @@ Also see the [CLI Doc](/commands/hugo_mod_clean/). ## Module workspaces -{{< new-in "0.109.0" >}} +{{< new-in 0.109.0 >}} Workspace support was added in [Go 1.18](https://go.dev/blog/get-familiar-with-workspaces) and Hugo got solid support for it in the `v0.109.0` version. diff --git a/content/en/hugo-pipes/postcss.md b/content/en/hugo-pipes/postcss.md index 5861237ec2..148b30a7ea 100755 --- a/content/en/hugo-pipes/postcss.md +++ b/content/en/hugo-pipes/postcss.md @@ -82,7 +82,7 @@ URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+San Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file. Hugo will look for imports relative to the module mount and will respect theme overrides. -skipInlineImportsNotFound {{< new-in "0.99.0" >}} +skipInlineImportsNotFound {{< new-in 0.99.0 >}} : (`bool`) Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true. {{< code file=layouts/partials/css.html >}} diff --git a/content/en/hugo-pipes/postprocess.md b/content/en/hugo-pipes/postprocess.md index 1aceae2089..e84c6d72d3 100755 --- a/content/en/hugo-pipes/postprocess.md +++ b/content/en/hugo-pipes/postprocess.md @@ -88,7 +88,7 @@ HUGO_ENVIRONMENT : The value e.g. set with `hugo -e production` (defaults to `production` for `hugo` and `development` for `hugo server`). HUGO_PUBLISHDIR -: {{< new-in "0.109.0" >}} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: +: {{< new-in 0.109.0 >}} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: ```sh hugo server --renderToDisk diff --git a/content/en/hugo-pipes/transpile-sass-to-css.md b/content/en/hugo-pipes/transpile-sass-to-css.md index c6a6f091a0..7ddbe573d1 100644 --- a/content/en/hugo-pipes/transpile-sass-to-css.md +++ b/content/en/hugo-pipes/transpile-sass-to-css.md @@ -42,7 +42,7 @@ transpiler targetPath : (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`. -vars {{< new-in "0.109.0" >}} +vars {{< new-in 0.109.0 >}} : (`map`) A map of key/value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/). ```scss @@ -62,7 +62,7 @@ precision enableSourceMap : (`bool`) If `true`, generates a source map. -sourceMapIncludeSources {{< new-in "0.108.0" >}} +sourceMapIncludeSources {{< new-in 0.108.0 >}} : (`bool`) If `true`, embeds sources in the generated source map. Not applicable to LibSass. includePaths diff --git a/content/en/methods/site/DisqusShortname.md b/content/en/methods/site/DisqusShortname.md new file mode 100644 index 0000000000..359b836af0 --- /dev/null +++ b/content/en/methods/site/DisqusShortname.md @@ -0,0 +1,20 @@ +--- +title: DisqusShortname +description: Returns the Disqus shortname as defined in the site configuration. +categories: [] +keywords: [] +action: + related: [] + returnType: string + signatures: [SITE.DisqusShortname] +# deprecated 2023-10-30 +expiryDate: 2024-10-30 +_build: + list: never +--- + +{{% deprecated-in 0.120.0 %}} +Use [`Site.Config.Services.Disqus.Shortname`] instead. + +[`Site.Config.Services.Disqus.Shortname`]: /methods/site/config +{{% /deprecated-in %}} diff --git a/content/en/methods/site/GoogleAnalytics.md b/content/en/methods/site/GoogleAnalytics.md new file mode 100644 index 0000000000..405cf0de5c --- /dev/null +++ b/content/en/methods/site/GoogleAnalytics.md @@ -0,0 +1,20 @@ +--- +title: GoogleAnalytics +description: Returns the Google Analytics tracking ID as defined in the site configuration. +categories: [] +keywords: [] +action: + related: [] + returnType: string + signatures: [SITE.GoogleAnalytics] +# deprecated 2023-10-30 +expiryDate: 2024-10-30 +_build: + list: never +--- + +{{% deprecated-in 0.120.0 %}} +Use [`Site.Config.Services.GoogleAnalytics.ID`] instead. + +[`Site.Config.Services.GoogleAnalytics.ID`]: /methods/site/config +{{% /deprecated-in %}} diff --git a/content/en/methods/site/IsDevelopment.md b/content/en/methods/site/IsDevelopment.md new file mode 100644 index 0000000000..fdeae15fae --- /dev/null +++ b/content/en/methods/site/IsDevelopment.md @@ -0,0 +1,20 @@ +--- +title: IsDevelopment +description: Reports whether the current running environment is “development”. +categories: [] +keywords: [] +action: + related: [] + returnType: bool + signatures: [SITE.IsDevelopment] +# deprecated 2023-10-30 +expiryDate: 2024-10-30 +_build: + list: never +--- + +{{% deprecated-in 0.120.0 %}} +Use [`hugo.IsDevelopment`] instead. + +[`hugo.IsDevelopment`]: /functions/hugo/isdevelopment +{{% /deprecated-in %}} diff --git a/content/en/methods/site/IsServer.md b/content/en/methods/site/IsServer.md new file mode 100644 index 0000000000..c19a84bc9b --- /dev/null +++ b/content/en/methods/site/IsServer.md @@ -0,0 +1,20 @@ +--- +title: IsServer +description: Reports whether the built-in development server is running. +categories: [] +keywords: [] +action: + related: [] + returnType: bool + signatures: [SITE.IsServer] +# deprecated 2023-10-30 +expiryDate: 2024-10-30 +_build: + list: never +--- + +{{% deprecated-in 0.120.0 %}} +Use [`hugo.IsServer`] instead. + +[`hugo.IsServer`]: /functions/hugo/isserver +{{% /deprecated-in %}} diff --git a/content/en/templates/render-hooks.md b/content/en/templates/render-hooks.md index d559c15917..8e174bdee2 100644 --- a/content/en/templates/render-hooks.md +++ b/content/en/templates/render-hooks.md @@ -23,7 +23,7 @@ The hook kinds currently supported are: * `image` * `link` * `heading` -* `codeblock`{{< new-in "0.93.0" >}} +* `codeblock`{{< new-in 0.93.0 >}} You can define [Output-Format-](/templates/output-formats) and [language-](/content-management/multilingual/)specific templates if needed. Your `layouts` folder may look like this: @@ -91,10 +91,10 @@ Attributes (map) The `render-image` templates will also receive: -IsBlock {{< new-in "0.108.0" >}} +IsBlock {{< new-in 0.108.0 >}} : Returns true if this is a standalone image and the configuration option [markup.goldmark.parser.wrapStandAloneImageWithinParagraph](/getting-started/configuration-markup/#goldmark) is disabled. -Ordinal {{< new-in "0.108.0" >}} +Ordinal {{< new-in 0.108.0 >}} : Zero-based ordinal for all the images in the current document. ### Link with title markdown example @@ -145,7 +145,7 @@ The rendered html will be ## Render hooks for code blocks -{{< new-in "0.93.0" >}} +{{< new-in 0.93.0 >}} You can add a hook template for either all code blocks or for a specific type/language (`bash` in the example below): diff --git a/content/en/troubleshooting/deprecation.md b/content/en/troubleshooting/deprecation.md index 79ddcc03f6..9aef54e8a7 100644 --- a/content/en/troubleshooting/deprecation.md +++ b/content/en/troubleshooting/deprecation.md @@ -25,8 +25,7 @@ Think of deprecation as a statement of intent. This Wikipedia [article] describe - The feature is considered extraneous, and will be removed in the future in order to simplify the system as a whole. - A future version of the software will make major structural changes, making it impossible or impractical to support older features. - Standardization or increased consistency in naming. -- A feature that once was available only independently is now combined with its co-feature. - +- A feature that once was available only independently is now combined with its co-feature. After the project team deprecates something in code, Hugo will: diff --git a/layouts/shortcodes/deprecated-in.html b/layouts/shortcodes/deprecated-in.html new file mode 100644 index 0000000000..cab85541d0 --- /dev/null +++ b/layouts/shortcodes/deprecated-in.html @@ -0,0 +1,14 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + +{{ with .Get 0 }} + {{ $version := printf "v%v" (strings.TrimLeft "vV" .) }} + {{ $href := printf "https://github.com/gohugoio/hugo/releases/tag/%s" $version }} + +{{ else }} + {{ errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }} +{{ end }} diff --git a/layouts/shortcodes/new-in.html b/layouts/shortcodes/new-in.html new file mode 100644 index 0000000000..9236cf2bc8 --- /dev/null +++ b/layouts/shortcodes/new-in.html @@ -0,0 +1,13 @@ +{{ $version := .Get 0 }} +{{ if not $version }} + {{ errorf "Missing version in new-in shortcode " }} +{{ end }} +{{ $version = $version | strings.TrimPrefix "v" }} + diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html new file mode 100644 index 0000000000..99818114e1 --- /dev/null +++ b/layouts/shortcodes/note.html @@ -0,0 +1,7 @@ +{{ $_hugo_config := `{ "version": 1 }` }} + +