diff --git a/content/en/about/privacy.md b/content/en/about/privacy.md index ef4faa793..828995c07 100644 --- a/content/en/about/privacy.md +++ b/content/en/about/privacy.md @@ -34,9 +34,9 @@ Some of these templates include settings to enhance privacy. ## Configuration -{{% note %}} +{{< note >}} These settings affect the behavior of some of Hugo's embedded templates. These settings may or may not affect the behavior of templates provided by third parties in their modules or themes. -{{% /note %}} +{{< /note >}} These are the default privacy settings for Hugo's embedded templates: diff --git a/content/en/content-management/build-options.md b/content/en/content-management/build-options.md index e78462455..b9762e563 100644 --- a/content/en/content-management/build-options.md +++ b/content/en/content-management/build-options.md @@ -60,12 +60,12 @@ render [`RelPermalink`]: /methods/resource/relpermalink/ [`Publish`]: /methods/resource/publish/ -{{% note %}} +{{< note >}} Any page, regardless of its build options, will always be available by using the [`.Page.GetPage`] or [`.Site.GetPage`] method. [`.Page.GetPage`]: /methods/page/getpage/ [`.Site.GetPage`]: /methods/site/getpage/ -{{% /note %}} +{{< /note >}} ## Example -- headless page diff --git a/content/en/content-management/content-adapters.md b/content/en/content-management/content-adapters.md index 420d49d9d..7339b4c68 100644 --- a/content/en/content-management/content-adapters.md +++ b/content/en/content-management/content-adapters.md @@ -91,9 +91,9 @@ Returns the `Site` to which the pages will be added. {{ .Site.Title }} {{< /code >}} -{{% note %}} +{{< note >}} Note that the `Site` returned isn't fully built when invoked from the content adapters; if you try to call methods that depends on pages, e.g. `.Site.Pages`, you will get an error saying "this method cannot be called before the site is fully initialized". -{{% /note %}} +{{< /note >}} ###### Store @@ -141,11 +141,11 @@ Key|Description|Required `path`|The page's [logical path](g) relative to the content adapter. Do not include a leading slash or file extension.|:heavy_check_mark: `title`|The page title.| -{{% note %}} +{{< note >}} While `path` is the only required field, we recommend setting `title` as well. When setting the `path`, Hugo transforms the given string to a logical path. For example, setting `path` to `A B C` produces a logical path of `/section/a-b-c`. -{{% /note %}} +{{< /note >}} ## Resource map @@ -160,11 +160,11 @@ Key|Description|Required `path`|The resources's [logical path](g) relative to the content adapter. Do not include a leading slash.|:heavy_check_mark: `title`|The resource title.| -{{% note %}} +{{< note >}} If the `content.value` is a string Hugo creates a new resource. If the `content.value` is a resource, Hugo obtains the value from the existing resource. When setting the `path`, Hugo transforms the given string to a logical path. For example, setting `path` to `A B C/cover.jpg` produces a logical path of `/section/a-b-c/cover.jpg`. -{{% /note %}} +{{< /note >}} ## Example diff --git a/content/en/content-management/data-sources.md b/content/en/content-management/data-sources.md index 1237e4f4d..b6942aaa0 100644 --- a/content/en/content-management/data-sources.md +++ b/content/en/content-management/data-sources.md @@ -22,9 +22,9 @@ The `data` directory in the root of your project may contain one or more data fi Hugo also merges data directories from themes and modules into this single data structure, where the `data` directory in the root of your project takes precedence. -{{% note %}} +{{< note >}} Hugo reads the combined data structure into memory and keeps it there for the entire build. For data that is infrequently accessed, use global or page resources instead. -{{% /note %}} +{{< /note >}} Theme and module authors may wish to namespace their data files to prevent collisions. For example: @@ -35,9 +35,9 @@ project/ └── foo.json ``` -{{% note %}} +{{< note >}} Do not place CSV files in the `data` directory. Access CSV files as page, global, or remote resources. -{{% /note %}} +{{< /note >}} See the documentation for the [`Data`] method on a `Site` object for details and examples. diff --git a/content/en/content-management/front-matter.md b/content/en/content-management/front-matter.md index 9f5fc9e11..0493c3308 100644 --- a/content/en/content-management/front-matter.md +++ b/content/en/content-management/front-matter.md @@ -45,11 +45,11 @@ Front matter fields may be [boolean](g), [integer](g), [float](g), [string](g), The most common front matter fields are `date`, `draft`, `title`, and `weight`, but you can specify metadata using any of fields below. -{{% note %}} +{{< note >}} The field names below are reserved. For example, you cannot create a custom field named `type`. Create custom fields under the `params` key. See the [parameters] section for details. [parameters]: #parameters -{{% /note %}} +{{< /note >}} ###### aliases @@ -382,11 +382,11 @@ Use any combination of these keywords to target a set of pages: Any of the above can be omitted. -{{% note %}} +{{< note >}} With a multilingual site it may be more efficient to define the `cascade` values in your site configuration to avoid duplicating the `cascade` values on the section, taxonomy, or term page for each language. With a multilingual site, if you choose to define the `cascade` values in front matter, you must create a section, taxonomy, or term page for each language; the `lang` keyword is ignored. -{{% /note %}} +{{< /note >}} ### Example diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index fa97edca6..05f40cd73 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -104,17 +104,17 @@ Example 4: Skips rendering if there's problem accessing a remote resource. The `image` resource implements the [`Process`], [`Resize`], [`Fit`], [`Fill`], [`Crop`], [`Filter`], [`Colors`] and [`Exif`] methods. -{{% note %}} +{{< note >}} Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. Use the `Exif` method with the _original_ image to extract EXIF metadata from JPEG, PNG, TIFF, and WebP images. -{{% /note %}} +{{< /note >}} ### Process {{< new-in 0.119.0 />}} -{{% note %}} +{{< 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). -{{% /note %}} +{{< /note >}} Process processes the image with the given specification. The specification can contain an optional action, one of `resize`, `crop`, `fit` or `fill`. This means that you can use this method instead of [`Resize`], [`Fit`], [`Fill`], or [`Crop`]. @@ -460,11 +460,11 @@ excludeFields includeFields : Regular expression matching the EXIF tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`. - {{% note %}} + {{< note >}} To improve performance and decrease cache size, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`. To control tag availability, change the `excludeFields` or `includeFields` settings as described above. - {{% /note %}} + {{< /note >}} ## Smart cropping of images diff --git a/content/en/content-management/mathematics.md b/content/en/content-management/mathematics.md index 0006de29d..2172c0fa4 100644 --- a/content/en/content-management/mathematics.md +++ b/content/en/content-management/mathematics.md @@ -43,13 +43,13 @@ Equations and expressions can be displayed inline with other text, or as standal Whether an equation or expression appears inline, or as a block, depends on the delimiters that surround the mathematical markup. Delimiters are defined in pairs, where each pair consists of an opening and closing delimiter. The opening and closing delimiters may be the same, or different. -{{% note %}} +{{< note >}} You can configure Hugo to render mathematical markup on the client side using the MathJax or KaTeX display engine, or you can render the markup with the [`transform.ToMath`] function while building your site. The first approach is described below. [`transform.ToMath`]: /functions/transform/tomath/ -{{% /note %}} +{{< /note >}} ## Setup @@ -73,11 +73,11 @@ math = true The configuration above enables mathematical rendering on every page unless you set the `math` parameter to `false` in front matter. To enable mathematical rendering as needed, set the `math` parameter to `false` in your site configuration, and set the `math` parameter to `true` in front matter. Use this parameter in your base template as shown in [Step 3]. -{{% note %}} +{{< note >}} The configuration above precludes the use of the `$...$` delimiter pair for inline equations. Although you can add this delimiter pair to the configuration and JavaScript, you will need to double-escape the `$` symbol when used outside of math contexts to avoid unintended formatting. See the [inline delimiters](#inline-delimiters) section for details. -{{% /note %}} +{{< /note >}} To disable passthrough of inline snippets, omit the `inline` key from the configuration: @@ -178,19 +178,19 @@ If you add the `$...$` delimiter pair to your configuration and JavaScript, you A \\$5 bill _saved_ is a \\$5 bill _earned_. ``` -{{% note %}} +{{< note >}} If you use the `$...$` delimiter pair for inline equations, and occasionally use the `$` symbol outside of math contexts, you must use MathJax instead of KaTeX to avoid unintended formatting caused by [this KaTeX limitation](https://github.com/KaTeX/KaTeX/issues/437). -{{% /note %}} +{{< /note >}} ## Engines MathJax and KaTeX are open-source JavaScript display engines. Both engines are fast, but at the time of this writing MathJax v3.2.2 is slightly faster than KaTeX v0.16.11. -{{% note %}} +{{< note >}} If you use the `$...$` delimiter pair for inline equations, and occasionally use the `$` symbol outside of math contexts, you must use MathJax instead of KaTeX to avoid unintended formatting caused by [this KaTeX limitation](https://github.com/KaTeX/KaTeX/issues/437). See the [inline delimiters](#inline-delimiters) section for details. -{{% /note %}} +{{< /note >}} To use KaTeX instead of MathJax, replace the partial template from [Step 2] with this: diff --git a/content/en/content-management/menus.md b/content/en/content-management/menus.md index 15cf505ea..1f7b339be 100644 --- a/content/en/content-management/menus.md +++ b/content/en/content-management/menus.md @@ -28,9 +28,9 @@ There are three ways to define menu entries: 1. In front matter 1. In site configuration -{{% note %}} +{{< note >}} Although you can use these methods in combination when defining a menu, the menu will be easier to conceptualize and maintain if you use one method throughout the site. -{{% /note %}} +{{< /note >}} ## Define automatically @@ -62,9 +62,9 @@ menus = ['main','footer'] Access the entry with `site.Menus.main` and `site.Menus.footer` in your templates. See [menu templates] for details. -{{% note %}} +{{< note >}} The configuration key in the examples above is `menus`. The `menu` (singular) configuration key is an alias for `menus`. -{{% /note %}} +{{< /note >}} ### Properties {#properties-front-matter} @@ -149,17 +149,17 @@ weight = 20 This creates a menu structure that you can access with `site.Menus.footer` in your templates. See [menu templates] for details. -{{% note %}} +{{< note >}} The configuration key in the examples above is `menus`. The `menu` (singular) configuration key is an alias for `menus`. -{{% /note %}} +{{< /note >}} ### Properties {#properties-site-configuration} -{{% note %}} +{{< note >}} The [properties available to entries defined in front matter] are also available to entries defined in site configuration. [properties available to entries defined in front matter]: /content-management/menus/#properties-front-matter -{{% /note %}} +{{< /note >}} Each menu entry defined in site configuration requires two or more properties: diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 8233185d5..e532da5af 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -30,9 +30,9 @@ Artificial languages with private use subtags as defined in [RFC 5646 § 2.2.7] - `hugolang` -{{% note %}} +{{< note >}} Private use subtags must not exceed 8 alphanumeric characters. -{{% /note %}} +{{< /note >}} [RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646#section-2.1 [RFC 5646 § 2.2.7]: https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.7 @@ -174,9 +174,9 @@ Note that you cannot disable the default content language. Hugo supports multiple languages in a multihost configuration. This means you can configure a `baseURL` per `language`. -{{% note %}} +{{< note >}} If a `baseURL` is set on the `language` level, then all languages must have one and they must all be different. -{{% /note %}} +{{< /note >}} Example: @@ -232,9 +232,9 @@ Their language is __assigned__ according to the language code added as a __suffi By having the same **path and base file name**, the content pieces are __linked__ together as translated pages. -{{% note %}} +{{< note >}} If a file has no language code, it will be assigned the default language. -{{% /note %}} +{{< /note >}} ### Translation by content directory @@ -314,9 +314,9 @@ If, across the linked bundles, two or more files share the same basename, only o * File from current language bundle, if present. * First file found across bundles by order of language `Weight`. -{{% note %}} +{{< note >}} Page Bundle resources follow the same language assignment logic as content files, both by file name (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`). -{{%/ note %}} +{{< /note >}} ## Reference translated content @@ -588,9 +588,9 @@ If a string does not have a translation for the current language, Hugo will use While translating a Hugo website, it can be handy to have a visual indicator of missing translations. The [`enableMissingTranslationPlaceholders` configuration option][config] will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation. -{{% note %}} +{{< note >}} Hugo will generate your website with these missing translation placeholders. It might not be suitable for production environments. -{{% /note %}} +{{< /note >}} For merging of content from other languages (i.e. missing content translations), see [lang.Merge]. diff --git a/content/en/content-management/organization/index.md b/content/en/content-management/organization/index.md index 99a3224bf..5d4f65a2d 100644 --- a/content/en/content-management/organization/index.md +++ b/content/en/content-management/organization/index.md @@ -73,9 +73,9 @@ The following demonstrates the relationships between your content organization a `_index.md` has a special role in Hugo. It allows you to add front matter and content to `home`, `section`, `taxonomy`, and `term` pages. -{{% note %}} +{{< note >}} **Tip:** You can get a reference to the content and metadata in `_index.md` using the [`.Site.GetPage` function](/methods/page/getpage). -{{% /note %}} +{{< /note >}} You can create one `_index.md` for your home page and one in each of your content sections, taxonomies, and terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website: diff --git a/content/en/content-management/page-bundles.md b/content/en/content-management/page-bundles.md index 3638f2fb5..d08db5cf4 100644 --- a/content/en/content-management/page-bundles.md +++ b/content/en/content-management/page-bundles.md @@ -35,9 +35,9 @@ leaf bundle branch bundle : A _branch bundle_ is a directory that contains an `_index.md` file and zero or more resources. Analogous to a physical branch, a branch bundle may have descendants including leaf bundles and other branch bundles. Top level directories with or without `_index.md` files are also branch bundles. This includes the home page. -{{% note %}} +{{< note >}} In the definitions above and the examples below, the extension of the index file depends on the [content format](g). For example, use `index.md` for Markdown content, `index.html` for HTML content, `index.adoc` for AsciiDoc content, etc. -{{% /note %}} +{{< /note >}} ## Comparison @@ -108,9 +108,9 @@ my-other-post another-leaf-bundle : This leaf bundle does not contain any page resources. -{{% note %}} +{{< note >}} Create leaf bundles at any depth within the `content` directory, but a leaf bundle may not contain another bundle. Leaf bundles do not have descendants. -{{% /note %}} +{{< /note >}} ## Branch bundles @@ -142,9 +142,9 @@ branch-bundle-1 branch-bundle-2 : This branch bundle contains an index file and a leaf bundle. -{{% note %}} +{{< note >}} Create branch bundles at any depth within the `content` directory. Branch bundles may have descendants. -{{% /note %}} +{{< /note >}} ## Headless bundles diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index 84c3309cd..978edad30 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -120,16 +120,16 @@ List the titles in the data file, and throw an error if the file does not exist. The page resources' metadata is managed from the corresponding page's front matter with an array/table parameter named `resources`. You can batch assign values using [wildcards](https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm). -{{% note %}} +{{< note >}} Resources of type `page` get `Title` etc. from their own front matter. -{{% /note %}} +{{< /note >}} name : (`string`) Sets the value returned in `Name`. -{{% note %}} +{{< note >}} The methods `Match`, `Get` and `GetMatch` use `Name` to match the resources. -{{% /note %}} +{{< /note >}} title : (`string`) Sets the value returned in `Title` @@ -173,9 +173,9 @@ From the example above: - All `PDF` files will get a new `Name`. The `name` parameter contains a special placeholder [`:counter`](#the-counter-placeholder-in-name-and-title), so the `Name` will be `pdf-file-1`, `pdf-file-2`, `pdf-file-3`. - Every docx in the bundle will receive the `word` icon. -{{% note %}} +{{< note >}} The order matters; only the first set values of the `title`, `name` and `params` keys will be used. Consecutive parameters will be set only for the ones not already set. In the above example, `.Params.icon` is first set to `"photo"` in `src = "documents/photo_specs.pdf"`. So that would not get overridden to `"pdf"` by the later set `src = "**.pdf"` rule. -{{% /note %}} +{{< /note >}} ### The `:counter` placeholder in `name` and `title` @@ -210,11 +210,11 @@ the `Name` and `Title` will be assigned to the resource files as follows: By default, with a multilingual single-host site, Hugo does not duplicate shared page resources when building the site. -{{% note %}} +{{< note >}} This behavior is limited to Markdown content. Shared page resources for other [content formats] are copied into each language bundle. [content formats]: /content-management/formats/ -{{% /note %}} +{{< /note >}} Consider this site configuration: @@ -289,7 +289,7 @@ public/ This approach reduces build times, storage requirements, bandwidth consumption, and deployment times, ultimately reducing cost. -{{% note %}} +{{< note >}} To resolve Markdown link and image destinations to the correct location, you must use link and image render hooks that capture the page resource with the [`Resources.Get`] method, and then invoke its [`RelPermalink`] method. By default, with multilingual single-host sites, Hugo enables its [embedded link render hook] and [embedded image render hook] to resolve Markdown link and image destinations. @@ -300,7 +300,7 @@ You may override the embedded render hooks as needed, provided they capture the [embedded image render hook]: /render-hooks/images/#default [`Resources.Get`]: /methods/page/resources/#get [`RelPermalink`]: /methods/resource/relpermalink/ -{{% /note %}} +{{< /note >}} Although duplicating shared page resources is inefficient, you can enable this feature in your site configuration if desired: diff --git a/content/en/content-management/related.md b/content/en/content-management/related.md index 6431d12a3..bd24635db 100644 --- a/content/en/content-management/related.md +++ b/content/en/content-management/related.md @@ -58,9 +58,9 @@ A fictional example using all of the above options: }} ``` -{{% note %}} +{{< note >}} We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 different methods: `Related`, `RelatedTo` and `RelatedIndices`. Now we have only one method: `Related`. The old methods are still available but deprecated. Also see [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature. -{{% /note %}} +{{< /note >}} ## Index content headings in related content @@ -117,9 +117,9 @@ Without any `related` configuration set on the project, Hugo's Related Content m Custom configuration should be set using the same syntax. -{{% note %}} +{{< note >}} If you add a `related` configuration section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults. -{{% /note %}} +{{< /note >}} ### Top level configuration options diff --git a/content/en/content-management/sections.md b/content/en/content-management/sections.md index ce6916fd3..3b8864339 100644 --- a/content/en/content-management/sections.md +++ b/content/en/content-management/sections.md @@ -17,9 +17,9 @@ aliases: [/content/sections/] A section is a top-level content directory, or any content directory with an `_index.md` file. A content directory with an `_index.md` file is also known as a [branch bundle](g). Section templates receive one or more page [collections](g) in [context](g). -{{% note %}} +{{< note >}} Although top-level directories without `_index.md` files are sections, we recommend creating `_index.md` files in _all_ sections. -{{% /note %}} +{{< /note >}} A typical site consists of one or more sections. For example: diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index 55d1ffa66..f373f5a05 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -81,9 +81,9 @@ Inline shortcodes process their inner content within the same context as regular [shortcode method]: /templates/shortcode/#methods -{{% note %}} +{{< note >}} You cannot [nest](#nesting) inline shortcodes. -{{% /note %}} +{{< /note >}} Learn more about creating shortcodes in the [shortcode templates] section. diff --git a/content/en/content-management/taxonomies.md b/content/en/content-management/taxonomies.md index 6ba9e2a25..ae80fc8a5 100644 --- a/content/en/content-management/taxonomies.md +++ b/content/en/content-management/taxonomies.md @@ -104,9 +104,9 @@ Custom taxonomies other than the [defaults](#default-taxonomies) must be defined ### Example: adding a custom taxonomy named "series" -{{% note %}} +{{< note >}} While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_. -{{% /note %}} +{{< /note >}} {{< code-toggle file=hugo >}} [taxonomies] @@ -126,9 +126,9 @@ If you want to have just the default `tags` taxonomy, and remove the `categories If you want to disable all taxonomies altogether, see the use of `disableKinds` in [Hugo Taxonomy Defaults](#default-taxonomies). -{{% note %}} +{{< note >}} You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose. -{{% /note %}} +{{< /note >}} ## Assign terms to content diff --git a/content/en/content-management/urls.md b/content/en/content-management/urls.md index ab0c7148a..9b0a81452 100644 --- a/content/en/content-management/urls.md +++ b/content/en/content-management/urls.md @@ -43,14 +43,14 @@ https://example.org/posts/my-first-post/ Set the `url` in front matter to override the entire path. Use this with either regular pages or section pages. -{{% note %}} +{{< note >}} Hugo does not sanitize the `url` front matter field, allowing you to generate: - File paths that contain characters reserved by the operating system. For example, file paths on Windows may not contain any of these [reserved characters]. Hugo throws an error if a file path includes a character reserved by the current operating system. - URLs that contain disallowed characters. For example, the less than sign (`<`) is not allowed in a URL. [reserved characters]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions -{{% /note %}} +{{< /note >}} If you set both `slug` and `url` in front matter, the `url` value takes precedence. @@ -355,11 +355,11 @@ Hugo provides two mutually exclusive configuration options to alter URLs _after_ #### Canonical URLs -{{% note %}} +{{< note >}} This is a legacy configuration option, superseded by template functions and Markdown render hooks, and will likely be [removed in a future release]. [removed in a future release]: https://github.com/gohugoio/hugo/issues/4733 -{{% /note %}} +{{< /note >}} If enabled, Hugo performs a search and replace _after_ it renders the page. It searches for site-relative URLs (those with a leading slash) associated with `action`, `href`, `src`, `srcset`, and `url` attributes. It then prepends the `baseURL` to create absolute URLs. @@ -378,9 +378,9 @@ canonifyURLs = true #### Relative URLs -{{% note %}} +{{< note >}} Do not enable this option unless you are creating a serverless site, navigable via the file system. -{{% /note %}} +{{< /note >}} If enabled, Hugo performs a search and replace _after_ it renders the page. It searches for site-relative URLs (those with a leading slash) associated with `action`, `href`, `src`, `srcset`, and `url` attributes. It then transforms the URL to be relative to the current page. diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md index ef6fd9d37..cde48a4c8 100644 --- a/content/en/contribute/development.md +++ b/content/en/contribute/development.md @@ -58,15 +58,15 @@ To build the extended or extended/deploy edition from source you must: [Go documentation]: https://go.dev/doc/code#Command [Go]: https://go.dev/doc/install -{{% note %}} +{{< note >}} See these [detailed instructions](https://discourse.gohugo.io/t/41370) to install GCC on Windows. -{{% /note %}} +{{< /note >}} ## GitHub workflow -{{% note %}} +{{< note >}} This section assumes that you have a working knowledge of Go, Git and GitHub, and are comfortable working on the command line. -{{% /note %}} +{{< /note >}} Use this workflow to create and submit pull requests. diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index 285985b3d..61643fcf0 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -111,9 +111,9 @@ Best → Be cautious when deleting files. No → Hugo is extremely fast.\ Yes → Hugo is fast. -{{% note %}} +{{< note >}} "It's an adverb, Sam. It's a lazy tool of a weak mind." (Outbreak, 1995). -{{% /note %}} +{{< /note >}} ### Level 6 headings @@ -305,18 +305,18 @@ draft: false Use the `deprecated-in` shortcode to indicate that a feature is deprecated: ```text -{{%/* deprecated-in 0.127.0 */%}} +{{* deprecated-in 0.144.0 */>}} Use [`hugo.IsServer`] instead. [`hugo.IsServer`]: /functions/hugo/isserver/ -{{%/* /deprecated-in */%}} +{{* /deprecated-in */>}} ``` -{{% deprecated-in 0.127.0 %}} +{{< deprecated-in 0.144.0 >}} Use [`hugo.IsServer`] instead. [`hugo.IsServer`]: /functions/hugo/isserver/ -{{% /deprecated-in %}} +{{< /deprecated-in >}} ### eturl @@ -362,21 +362,21 @@ Use the `new-in` shortcode to indicate a new feature: ### note -Use the `note` shortcode with `{{%/* */%}}` delimiters to call attention to important content: +Use the `note` shortcode to call attention to important content: ```text -{{%/* note */%}} +{{* note */>}} Use the [`math.Mod`] function to control... [`math.Mod`]: /functions/math/mod/ -{{%/* /note */%}} +{{* /note */>}} ``` -{{% note %}} +{{< note >}} Use the [`math.Mod`] function to control... [`math.Mod`]: /functions/math/mod/ -{{% /note %}} +{{< /note >}} ## New features @@ -393,11 +393,11 @@ The "new in" label will be hidden if the specified version is older than a prede Use the "deprecated-in" shortcode to indicate that a feature is deprecated: {{< code file=content/something/foo.md >}} -{{%/* deprecated-in 0.120.0 */%}} +{{* deprecated-in 0.144.0 */>}} Use [`hugo.IsServer`] instead. [`hugo.IsServer`]: /functions/hugo/isserver/ -{{%/* /deprecated-in */%}} +{{* /deprecated-in */>}} {{< /code >}} When deprecating a function or method, add something like this to front matter: @@ -410,9 +410,9 @@ Set the `expiryDate` to two years from the date of deprecation, and add a brief ## GitHub workflow -{{% note %}} +{{< note >}} This section assumes that you have a working knowledge of Git and GitHub, and are comfortable working on the command line. -{{% /note %}} +{{< /note >}} Use this workflow to create and submit pull requests. diff --git a/content/en/functions/_common/highlighting-options.md b/content/en/functions/_common/highlighting-options.md index 2d07ccccc..d3f986502 100644 --- a/content/en/functions/_common/highlighting-options.md +++ b/content/en/functions/_common/highlighting-options.md @@ -11,9 +11,9 @@ codeFences guessSyntax : (`bool`) Whether to automatically detect the language if the `LANG` argument is blank or set to a language for which there is no corresponding [lexer](g). Falls back to a plain text lexer if unable to automatically detect the language. Default is `false`. -{{% note %}} +{{< note >}} The Chroma syntax highlighter includes lexers for approximately 250 languages, but only 5 of these have implemented automatic language detection. -{{% /note %}} +{{< /note >}} hl_Lines : (`string`) A space-delimited list of lines to emphasize within the highlighted code. To emphasize lines 2, 3, 4, and 7, set this value to `2-4 7`. This option is independent of the `lineNoStart` option. @@ -48,7 +48,7 @@ wrapperClass {{< new-in 0.140.2 />}} : (`string`) The class or classes to use for the outermost element of the highlighted code. Default is `highlight`. -{{% note %}} +{{< note >}} Instead of specifying both `lineNos` and `lineNumbersInTable`, you can use the following shorthand notation: lineNos=inline @@ -56,4 +56,4 @@ lineNos=inline lineNos=table : equivalent to `lineNos=true` and `lineNumbersInTable=true` -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/_common/locales.md b/content/en/functions/_common/locales.md index 42d008776..abcfb41c2 100644 --- a/content/en/functions/_common/locales.md +++ b/content/en/functions/_common/locales.md @@ -2,9 +2,9 @@ _comment: Do not remove front matter. --- -{{% note %}} +{{< note >}} Localization of dates, currencies, numbers, and percentages is performed by the [gohugoio/locales] package. The language tag of the current site must match one of the listed locales. [gohugoio/locales]: https://github.com/gohugoio/locales -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/cast/ToInt.md b/content/en/functions/cast/ToInt.md index c4bb10268..3e272cba4 100644 --- a/content/en/functions/cast/ToInt.md +++ b/content/en/functions/cast/ToInt.md @@ -46,8 +46,8 @@ With a hexadecimal (base 16) input: {{ int "0x11" }} → 17 (int) ``` -{{% note %}} +{{< note >}} Values with a leading zero are octal (base 8). When casting a string representation of a decimal (base 10) number, remove leading zeros: `{{ strings.TrimLeft "0" "0011" | int }} → 11` -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/collections/Complement.md b/content/en/functions/collections/Complement.md index 1c785de0b..b4c59822d 100644 --- a/content/en/functions/collections/Complement.md +++ b/content/en/functions/collections/Complement.md @@ -24,11 +24,11 @@ To find the elements within `$c3` that do not exist in `$c1` or `$c2`: {{ complement $c1 $c2 $c3 }} → [1 2] ``` -{{% note %}} +{{< note >}} Make your code simpler to understand by using a [chained pipeline]: [chained pipeline]: https://pkg.go.dev/text/template#hdr-Pipelines -{{% /note %}} +{{< /note >}} ```go-html-template {{ $c3 | complement $c1 $c2 }} → [1 2] @@ -55,11 +55,11 @@ To list everything except blog articles (`blog`) and frequently asked questions {{ end }} ``` -{{% note %}} +{{< note >}} Although the example above demonstrates the `complement` function, you could use the [`where`] function as well: [`where`]: /functions/collections/where/ -{{% /note %}} +{{< /note >}} ```go-html-template {{ range where site.RegularPages "Type" "not in" (slice "blog" "faqs") }} diff --git a/content/en/functions/collections/Delimit.md b/content/en/functions/collections/Delimit.md index b85059d4b..6370ca17d 100644 --- a/content/en/functions/collections/Delimit.md +++ b/content/en/functions/collections/Delimit.md @@ -22,9 +22,9 @@ Delimit a slice: Delimit a map: -{{% note %}} +{{< note >}} The `delimit` function sorts maps by key, returning the values. -{{% /note %}} +{{< /note >}} ```go-html-template {{ $m := dict "b" 2 "a" 1 "c" 3 }} diff --git a/content/en/functions/collections/IsSet.md b/content/en/functions/collections/IsSet.md index 62b81b712..431a2aae6 100644 --- a/content/en/functions/collections/IsSet.md +++ b/content/en/functions/collections/IsSet.md @@ -40,6 +40,6 @@ But if the value of `showHeroImage` is `false`, we can't use either `if` or `wit {{ end }} ``` -{{% note %}} +{{< note >}} When using the `isset` function you must reference the key using lower case. See the previous example. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/collections/Merge.md b/content/en/functions/collections/Merge.md index 3f5208cfc..7cc788f85 100644 --- a/content/en/functions/collections/Merge.md +++ b/content/en/functions/collections/Merge.md @@ -64,6 +64,6 @@ Example 4 {{ $merged.z.a }} → huey ``` -{{% note %}} +{{< note >}} Regardless of depth, merging only applies to maps. For slices, use [append](/functions/collections/append). -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/collections/Seq.md b/content/en/functions/collections/Seq.md index b572bd7c0..b9f66e8d7 100644 --- a/content/en/functions/collections/Seq.md +++ b/content/en/functions/collections/Seq.md @@ -31,6 +31,6 @@ A contrived example of iterating over a sequence of integers: {{ $product }} → 24 ``` -{{% note %}} +{{< note >}} The slice created by the `seq` function is limited to 2000 elements. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/collections/Sort.md b/content/en/functions/collections/Sort.md index 815260f20..ae8f30609 100644 --- a/content/en/functions/collections/Sort.md +++ b/content/en/functions/collections/Sort.md @@ -65,9 +65,9 @@ firstName = "Jean" lastName = "Valjean" {{< /code-toggle >}} -{{% note %}} +{{< note >}} When sorting maps, the `KEY` argument must be lowercase. -{{% /note %}} +{{< /note >}} ### Ascending order {#map-ascending-order} @@ -141,11 +141,11 @@ After sorting: ## Sort a page collection -{{% note %}} +{{< note >}} Although you can use the `sort` function to sort a page collection, Hugo provides [sorting and grouping methods] as well. [sorting and grouping methods]: /methods/pages/ -{{% /note %}} +{{< /note >}} In this contrived example, sort the site's regular pages by `.Type` in descending order: diff --git a/content/en/functions/collections/Where.md b/content/en/functions/collections/Where.md index 014a063a1..ea02d3ef2 100644 --- a/content/en/functions/collections/Where.md +++ b/content/en/functions/collections/Where.md @@ -90,9 +90,9 @@ Use any of the following logical operators: `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 %}} +{{< note >}} The examples below perform comparisons within a page collection, but the same comparisons are applicable to a slice of maps. -{{% /note %}} +{{< /note >}} ## String comparison @@ -178,9 +178,9 @@ To return a collection of pages where the "author" page parameter begins with ei {{% include "functions/_common/regular-expressions.md" %}} -{{% note %}} +{{< note >}} Use the `like` operator to compare string values. Comparing other data types will result in an empty collection. -{{% /note %}} +{{< /note >}} ## Date comparison @@ -205,9 +205,9 @@ For example, to return a collection of pages that were created before the curren With custom front matter dates, the comparison depends on the front matter data format (TOML, YAML, or JSON). -{{% note %}} +{{< note >}} Using TOML for pages with custom front matter dates enables precise date comparisons. -{{% /note %}} +{{< /note >}} With TOML, date values are first-class citizens. TOML has a date data type while JSON and YAML do not. If you quote a TOML date, it is a string. If you do not quote a TOML date value, it is [`time.Time`] value, enabling precise comparisons. diff --git a/content/en/functions/compare/Default.md b/content/en/functions/compare/Default.md index bf859d51c..ab52367ec 100644 --- a/content/en/functions/compare/Default.md +++ b/content/en/functions/compare/Default.md @@ -14,7 +14,7 @@ aliases: [/functions/default] The `default` function returns the second argument if set, else the first argument. -{{% note %}} +{{< note >}} When the second argument is the boolean `false` value, the `default` function returns `false`. All _other_ falsy values are considered unset. {{% include "functions/go-template/_common/truthy-falsy.md" %}} @@ -22,7 +22,7 @@ When the second argument is the boolean `false` value, the `default` function re To set a default value based on truthiness, use the [`or`] operator instead. [`or`]: /functions/go-template/or/ -{{% /note %}} +{{< /note >}} The `default` function returns the second argument if set: diff --git a/content/en/functions/crypto/FNV32a.md b/content/en/functions/crypto/FNV32a.md index 0255349a3..3c13346c5 100644 --- a/content/en/functions/crypto/FNV32a.md +++ b/content/en/functions/crypto/FNV32a.md @@ -11,8 +11,8 @@ action: expiryDate: 2026-07-31 # deprecated 2024-07-31 in v0.129.0 --- -{{% deprecated-in 0.129.0 %}} +{{< deprecated-in 0.129.0 >}} Use [`hash.FNV32a`] instead. [`hash.FNV32a`]: /functions/hash/FNV32a/ -{{% /deprecated-in %}} +{{< /deprecated-in >}} diff --git a/content/en/functions/css/PostCSS.md b/content/en/functions/css/PostCSS.md index 1a1a792ec..9b806c2a9 100644 --- a/content/en/functions/css/PostCSS.md +++ b/content/en/functions/css/PostCSS.md @@ -50,9 +50,9 @@ module.exports = { }; {{< /code >}} -{{% note %}} +{{< note >}} {{% include "functions/resources/_common/postcss-windows-warning.md" %}} -{{% /note %}} +{{< /note >}} Step 4 : Place your CSS file within the `assets/css` directory. diff --git a/content/en/functions/data/GetCSV.md b/content/en/functions/data/GetCSV.md index be848bce5..40e6de7e1 100644 --- a/content/en/functions/data/GetCSV.md +++ b/content/en/functions/data/GetCSV.md @@ -12,14 +12,14 @@ toc: true expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0 --- -{{% deprecated-in 0.123.0 %}} +{{< deprecated-in 0.123.0 >}} Instead, use [`transform.Unmarshal`] with a [global resource](g), [page resource](g), or [remote resource](g). See the [remote data example]. [`transform.Unmarshal`]: /functions/transform/unmarshal/ [remote data example]: /functions/resources/getremote/#remote-data -{{% /deprecated-in %}} +{{< /deprecated-in >}} Given the following directory structure: @@ -36,11 +36,11 @@ Access the data with either of the following: {{ $data := getCSV "," "other-files/" "pets.csv" }} ``` -{{% note %}} +{{< note >}} When working with local data, the file path is relative to the working directory. You must not place CSV files in the project's `data` directory. -{{% /note %}} +{{< /note >}} Access remote data with either of the following: diff --git a/content/en/functions/data/GetJSON.md b/content/en/functions/data/GetJSON.md index 1b42cbf16..58334174b 100644 --- a/content/en/functions/data/GetJSON.md +++ b/content/en/functions/data/GetJSON.md @@ -12,14 +12,14 @@ toc: true expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0 --- -{{% deprecated-in 0.123.0 %}} +{{< deprecated-in 0.123.0 >}} Instead, use [`transform.Unmarshal`] with a [global resource](g), [page resource](g), or [remote resource](g). See the [remote data example]. [`transform.Unmarshal`]: /functions/transform/unmarshal/ [remote data example]: /functions/resources/getremote/#remote-data -{{% /deprecated-in %}} +{{< /deprecated-in >}} Given the following directory structure: @@ -36,9 +36,9 @@ Access the data with either of the following: {{ $data := getJSON "other-files/" "books.json" }} ``` -{{% note %}} +{{< note >}} When working with local data, the file path is relative to the working directory. -{{% /note %}} +{{< /note >}} Access remote data with either of the following: diff --git a/content/en/functions/debug/Dump.md b/content/en/functions/debug/Dump.md index 67b264bed..20c0ae8a2 100644 --- a/content/en/functions/debug/Dump.md +++ b/content/en/functions/debug/Dump.md @@ -29,6 +29,6 @@ action: ] ``` -{{% note %}} +{{< note >}} Output from this function may change from one release to the next. Use for debugging only. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/global/page.md b/content/en/functions/global/page.md index 1dc8be515..0ebb3a7d8 100644 --- a/content/en/functions/global/page.md +++ b/content/en/functions/global/page.md @@ -27,9 +27,9 @@ When a `Page` object is not in context, you can use the global `page` function: {{ page.Params.foo }} ``` -{{% note %}} +{{< note >}} Do not use the global `page` function in shortcodes, partials called by shortcodes, or cached partials. See [warnings](#warnings) below. -{{% /note %}} +{{< /note >}} ## Explanation diff --git a/content/en/functions/global/site.md b/content/en/functions/global/site.md index a4879fee0..fd29bd6de 100644 --- a/content/en/functions/global/site.md +++ b/content/en/functions/global/site.md @@ -27,6 +27,6 @@ When the `Site` object is in context you can use the `Site` property: {{ $.Site.Params.foo }} ``` -{{% note %}} +{{< note >}} To simplify your templates, use the global `site` function regardless of whether the `Site` object is in context. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/go-template/range.md b/content/en/functions/go-template/range.md index 96713c4b7..94f654a55 100644 --- a/content/en/functions/go-template/range.md +++ b/content/en/functions/go-template/range.md @@ -59,9 +59,9 @@ Hugo will throw an error: The error occurs because we are trying to use the `.Title` method on an integer instead of a `Page` object. Within the `range` block, if we want to render the page title, we need to get the context passed into the template. -{{% note %}} +{{< note >}} Use the `$` to get the context passed into the template. -{{% /note %}} +{{< /note >}} This template will render the page title three times: @@ -71,9 +71,9 @@ This template will render the page title three times: {{ end }} ``` -{{% note %}} +{{< note >}} Gaining a thorough understanding of context is critical for anyone writing template code. -{{% /note %}} +{{< /note >}} [`seq`]: /functions/collections/seq/ diff --git a/content/en/functions/go-template/return.md b/content/en/functions/go-template/return.md index df5b2496e..9b40889e1 100644 --- a/content/en/functions/go-template/return.md +++ b/content/en/functions/go-template/return.md @@ -19,9 +19,9 @@ The returned value may be of any data type including, but not limited to, [`bool A `return` statement without a value returns an empty string of type `template.HTML`. -{{% note %}} +{{< note >}} Unlike `return` statements in other languages, Hugo executes the first occurrence of the `return` statement regardless of its position within logical blocks. See [usage](#usage) notes below. -{{% /note %}} +{{< /note >}} ## Example @@ -70,9 +70,9 @@ See additional examples in the [partial templates] section. ## Usage -{{% note %}} +{{< note >}} Unlike `return` statements in other languages, Hugo executes the first occurrence of the `return` statement regardless of its position within logical blocks. -{{% /note %}} +{{< /note >}} A partial that returns a value must contain only one `return` statement, placed at the end of the template. @@ -88,9 +88,9 @@ For example: {{ return $result }} {{< /code >}} -{{% note %}} +{{< note >}} The construct below is incorrect; it contains more than one `return` statement. -{{% /note %}} +{{< /note >}} {{< code file="layouts/partials/do-not-do-this.html" >}} {{ if math.ModBool . 2 }} diff --git a/content/en/functions/go-template/try.md b/content/en/functions/go-template/try.md index f3385a04c..979c90b61 100644 --- a/content/en/functions/go-template/try.md +++ b/content/en/functions/go-template/try.md @@ -108,6 +108,6 @@ In the above, note that the [context](g) within the last conditional block is th [template context]: /templates/introduction/#template-context -{{% note %}} +{{< note >}} Hugo does not classify an HTTP response with status code 404 as an error. In this case `resources.GetRemote` returns nil. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/go-template/with.md b/content/en/functions/go-template/with.md index a730f4d2c..64f8859bf 100644 --- a/content/en/functions/go-template/with.md +++ b/content/en/functions/go-template/with.md @@ -78,9 +78,9 @@ Hugo will throw an error: The error occurs because we are trying to use the `.Title` method on an integer instead of a `Page` object. Inside of the `with` block, if we want to render the page title, we need to get the context passed into the template. -{{% note %}} +{{< note >}} Use the `$` to get the context passed into the template. -{{% /note %}} +{{< /note >}} This template will render the page title as desired: @@ -90,9 +90,9 @@ This template will render the page title as desired: {{ end }} ``` -{{% note %}} +{{< note >}} Gaining a thorough understanding of context is critical for anyone writing template code. -{{% /note %}} +{{< /note >}} {{% include "functions/go-template/_common/text-template.md" %}} diff --git a/content/en/functions/images/AutoOrient.md b/content/en/functions/images/AutoOrient.md index 8e3708eea..fca9d392e 100644 --- a/content/en/functions/images/AutoOrient.md +++ b/content/en/functions/images/AutoOrient.md @@ -25,9 +25,9 @@ Create the filter: {{% include "functions/images/_common/apply-image-filter.md" %}} -{{% note %}} +{{< note >}} When using with other filters, specify `images.AutoOrient` first. -{{% /note %}} +{{< /note >}} ```go-html-template {{ $filters := slice diff --git a/content/en/functions/images/Config.md b/content/en/functions/images/Config.md index 8f79a65f8..4df088033 100644 --- a/content/en/functions/images/Config.md +++ b/content/en/functions/images/Config.md @@ -24,10 +24,10 @@ See [image processing] for an overview of Hugo's image pipeline. Supported image formats include GIF, JPEG, PNG, TIFF, and WebP. -{{% note %}} +{{< note >}} This is a legacy function, superseded by the [`Width`] and [`Height`] methods for [global resources](g), [page resources](g), and [remote resources](g). See the [image processing] section for details. [`Width`]: /methods/resource/width/ [`Height`]: /methods/resource/height/ [image processing]: /content-management/image-processing/ -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/images/Mask.md b/content/en/functions/images/Mask.md index 8116e8946..11fce93b0 100644 --- a/content/en/functions/images/Mask.md +++ b/content/en/functions/images/Mask.md @@ -17,9 +17,9 @@ toc: true 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. -{{% note %}} +{{< note >}} Of the formats supported by Hugo's imaging pipelie, only PNG and WebP have an alpha channel to support transparency. If your source image has a different format and you require transparent masked areas, convert it to either PNG or WebP as shown in the example below. -{{% /note %}} +{{< /note >}} When applying a mask to a non-transparent image format such as JPEG, the masked areas will be filled with the color specified by the `bgColor` parameter in your [site configuration]. You can override that color with a `Process` image filter: diff --git a/content/en/functions/images/QR.md b/content/en/functions/images/QR.md index e3f914fd1..cbefaefff 100644 --- a/content/en/functions/images/QR.md +++ b/content/en/functions/images/QR.md @@ -116,9 +116,9 @@ If the QR code will be printed, use the default `scale` value of `4` pixels per Avoid using Hugo's image processing methods to resize QR codes. Resizing can introduce blurring due to anti-aliasing when a QR code module occupies a fractional number of pixels. -{{% note %}} +{{< note >}} Always test the rendered QR code both on-screen and in print. -{{% /note %}} +{{< /note >}} ## Shortcode diff --git a/content/en/functions/js/Batch.md b/content/en/functions/js/Batch.md index 08913f61f..fe9ec979f 100644 --- a/content/en/functions/js/Batch.md +++ b/content/en/functions/js/Batch.md @@ -16,9 +16,9 @@ weight: 20 toc: true --- -{{% note %}} +{{< note >}} For a runnable example of this feature, see [this test and demo repo](https://github.com/bep/hugojsbatchdemo/). -{{% /note %}} +{{< /note >}} The Batch `ID` is used to create the base directory for this batch. Forward slashes are allowed. `js.Batch` returns an object with an API with this structure: @@ -250,13 +250,13 @@ Eeach [`Resource`] will be of media type `application/javascript` or `text/css`. In a template you would typically handle one group with a given `ID` (e.g. scripts for the current section). Because of the concurrent build, this needs to be done in a [`templates.Defer`] block: -{{% note %}} +{{< note >}} The [`templates.Defer`] acts as a synchronisation point to handle scripts added concurrently by different templates. If you have a setup with where the batch is created in one go (in one template), you don't need it. See [this discussion](https://discourse.gohugo.io/t/js-batch-with-simple-global-script/53002/5?u=bep) for more. [`templates.Defer`]: /functions/templates/defer/ -{{% /note %}} +{{< /note >}} ```go-html-template {{ $group := .group }} diff --git a/content/en/functions/js/Build.md b/content/en/functions/js/Build.md index 9bdc2454a..e1fb7d2e2 100644 --- a/content/en/functions/js/Build.md +++ b/content/en/functions/js/Build.md @@ -109,9 +109,9 @@ Any imports in a file outside `assets` or that does not resolve to a component i The start directory for resolving npm packages (aka. packages that live inside a `node_modules` directory) is always the main project directory. -{{% note %}} +{{< 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 %}} +{{< /note >}} ## Examples diff --git a/content/en/functions/lang/Translate.md b/content/en/functions/lang/Translate.md index 48c1345e2..60f2b0337 100644 --- a/content/en/functions/lang/Translate.md +++ b/content/en/functions/lang/Translate.md @@ -20,14 +20,14 @@ If the key is not found in the translation table for the current language, the ` If the key is not found in the translation table for the `defaultContentLanguage`, the `lang.Translate` function returns an empty string. -{{% note %}} +{{< note >}} To list missing and fallback translations, use the `--printI18nWarnings` flag when building your site. To render placeholders for missing and fallback translations, set [`enableMissingTranslationPlaceholders`] to `true` in your site configuration. [`enableMissingTranslationPlaceholders`]: /getting-started/configuration/#enablemissingtranslationplaceholders -{{% /note %}} +{{< /note >}} ## Translation tables @@ -76,9 +76,9 @@ privacy = 'prywatność' security = 'bezpieczeństwo' {{< /code-toggle >}} -{{% note %}} +{{< note >}} The examples below use the `T` alias for brevity. -{{% /note %}} +{{< /note >}} When viewing the English language site: @@ -136,9 +136,9 @@ many = '{{ . }} miesięcy' other = '{{ . }} miesiąca' {{< /code-toggle >}} -{{% note %}} +{{< note >}} The examples below use the `T` alias for brevity. -{{% /note %}} +{{< /note >}} When viewing the English language site: @@ -185,9 +185,9 @@ Template code: {{ T "age" (dict "name" "John" "count" 3) }} → John is 3 years old. ``` -{{% note %}} +{{< note >}} Translation tables may contain both simple translations and translations with pluralization. -{{% /note %}} +{{< /note >}} ## Reserved keys diff --git a/content/en/functions/math/Counter.md b/content/en/functions/math/Counter.md index 457806b8e..5daf1ea19 100644 --- a/content/en/functions/math/Counter.md +++ b/content/en/functions/math/Counter.md @@ -30,6 +30,6 @@ Use this function to: [`warnf`]: /functions/fmt/warnf/ [`resources.FromString`]: /functions/resources/fromstring/ -{{% note %}} +{{< note >}} Due to concurrency, the value returned in a given template for a given page will vary from one build to the next. You cannot use this function to assign a static id to each page. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/partials/IncludeCached.md b/content/en/functions/partials/IncludeCached.md index 8b57c3399..ebce49145 100644 --- a/content/en/functions/partials/IncludeCached.md +++ b/content/en/functions/partials/IncludeCached.md @@ -22,11 +22,11 @@ Without a [`return`] statement, the `partialCached` function returns a string of The `partialCached` function can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation. -{{% note %}} +{{< note >}} Each Site (or language) has its own `partialCached` cache, so each site will execute a partial once. 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 %}} +{{< /note >}} Here is the simplest usage: diff --git a/content/en/functions/resources/Babel.md b/content/en/functions/resources/Babel.md index 757aff780..8fd0c58cc 100644 --- a/content/en/functions/resources/Babel.md +++ b/content/en/functions/resources/Babel.md @@ -10,8 +10,8 @@ action: expiryDate: 2026-06-24 # deprecated 2024-06-24 in v0.128.0 --- -{{% deprecated-in 0.128.0 %}} +{{< deprecated-in 0.128.0 >}} Use [`js.Babel`] instead. [`js.Babel`]: /functions/js/babel/ -{{% /deprecated-in %}} +{{< /deprecated-in >}} diff --git a/content/en/functions/resources/ByType.md b/content/en/functions/resources/ByType.md index ba9dcde0c..273460d8c 100644 --- a/content/en/functions/resources/ByType.md +++ b/content/en/functions/resources/ByType.md @@ -23,12 +23,12 @@ The [media type] is typically one of `image`, `text`, `audio`, `video`, or `appl {{ end }} ``` -{{% note %}} +{{< note >}} This function operates on global resources. A global resource is a file within the `assets` directory, or within any directory mounted to the `assets` directory. For page resources, use the [`Resources.ByType`] method on a `Page` object. [`Resources.ByType`]: /methods/page/resources/ -{{% /note %}} +{{< /note >}} [media type]: https://en.wikipedia.org/wiki/Media_type diff --git a/content/en/functions/resources/Copy.md b/content/en/functions/resources/Copy.md index 3be3dfd57..946c83c23 100644 --- a/content/en/functions/resources/Copy.md +++ b/content/en/functions/resources/Copy.md @@ -23,6 +23,6 @@ The relative URL of the new published resource will be: /img/new-image-name.jpg ``` -{{% note %}} +{{< note >}} Use the `resources.Copy` function with global, page, and remote resources. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/resources/Get.md b/content/en/functions/resources/Get.md index c6450febf..1702b0415 100644 --- a/content/en/functions/resources/Get.md +++ b/content/en/functions/resources/Get.md @@ -21,10 +21,10 @@ action: {{ end }} ``` -{{% note %}} +{{< note >}} This function operates on global resources. A global resource is a file within the `assets` directory, or within any directory mounted to the `assets` directory. For page resources, use the [`Resources.Get`] method on a `Page` object. [`Resources.Get`]: /methods/page/resources/ -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/resources/GetMatch.md b/content/en/functions/resources/GetMatch.md index 7af2e7be8..81f430706 100644 --- a/content/en/functions/resources/GetMatch.md +++ b/content/en/functions/resources/GetMatch.md @@ -21,13 +21,13 @@ action: {{ end }} ``` -{{% note %}} +{{< note >}} This function operates on global resources. A global resource is a file within the `assets` directory, or within any directory mounted to the `assets` directory. For page resources, use the [`Resources.GetMatch`] method on a `Page` object. [`Resources.GetMatch`]: /methods/page/resources/ -{{% /note %}} +{{< /note >}} Hugo determines a match using a case-insensitive [glob pattern]. diff --git a/content/en/functions/resources/GetRemote.md b/content/en/functions/resources/GetRemote.md index 3b294e5a1..a617a0ccd 100644 --- a/content/en/functions/resources/GetRemote.md +++ b/content/en/functions/resources/GetRemote.md @@ -69,11 +69,11 @@ The `resources.GetRemote` function takes an optional map of options. ## Options examples -{{% note %}} +{{< note >}} For brevity, the examples below do not include [error handling]. [error handling]: #error-handling -{{% /note %}} +{{< /note >}} To include a header: @@ -148,7 +148,7 @@ When retrieving remote data, use the [`transform.Unmarshal`] function to [unmars {{ end }} ``` -{{% note %}} +{{< note >}} When retrieving remote data, a misconfigured server may send a response header with an incorrect [Content-Type]. For example, the server may set the Content-Type header to `application/octet-stream` instead of `application/json`. In these cases, pass the resource `Content` through the `transform.Unmarshal` function instead of passing the resource itself. For example, in the above, do this instead: @@ -156,7 +156,7 @@ In these cases, pass the resource `Content` through the `transform.Unmarshal` fu `{{ $data = .Content | transform.Unmarshal }}` [Content-Type]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type -{{% /note %}} +{{< /note >}} ## Error handling @@ -164,9 +164,9 @@ Use the [`try`] statement to capture HTTP request errors. If you do not handle t [`try`]: /functions/go-template/try -{{% note %}} +{{< note >}} Hugo does not classify an HTTP response with status code 404 as an error. In this case `resources.GetRemote` returns nil. -{{% /note %}} +{{< /note >}} ```go-html-template {{ $url := "https://broken-example.org/images/a.jpg" }} diff --git a/content/en/functions/resources/Match.md b/content/en/functions/resources/Match.md index 3e65555ba..dd163180c 100644 --- a/content/en/functions/resources/Match.md +++ b/content/en/functions/resources/Match.md @@ -21,13 +21,13 @@ action: {{ end }} ``` -{{% note %}} +{{< note >}} This function operates on global resources. A global resource is a file within the `assets` directory, or within any directory mounted to the `assets` directory. For page resources, use the [`Resources.Match`] method on a `Page` object. [`Resources.Match`]: /methods/page/resources/ -{{% /note %}} +{{< /note >}} Hugo determines a match using a case-insensitive [glob pattern]. diff --git a/content/en/functions/resources/PostCSS.md b/content/en/functions/resources/PostCSS.md index 5d3f85a30..faa328dc2 100644 --- a/content/en/functions/resources/PostCSS.md +++ b/content/en/functions/resources/PostCSS.md @@ -10,8 +10,8 @@ action: expiryDate: 2026-06-24 # deprecated 2024-06-24 in v0.128.0 --- -{{% deprecated-in 0.128.0 %}} +{{< deprecated-in 0.128.0 >}} Use [`css.PostCSS`] instead. [`css.PostCSS`]: /functions/css/postcss/ -{{% /deprecated-in %}} +{{< /deprecated-in >}} diff --git a/content/en/functions/resources/PostProcess.md b/content/en/functions/resources/PostProcess.md index b157d5fd9..7c4116995 100644 --- a/content/en/functions/resources/PostProcess.md +++ b/content/en/functions/resources/PostProcess.md @@ -85,9 +85,9 @@ module.exports = { }; {{< /code >}} -{{% note %}} +{{< note >}} {{% include "functions/resources/_common/postcss-windows-warning.md" %}} -{{% /note %}} +{{< /note >}} Step 5 : Place your CSS file within the `assets/css` directory. diff --git a/content/en/functions/resources/ToCSS.md b/content/en/functions/resources/ToCSS.md index 54c34a6b0..8cbb7faff 100644 --- a/content/en/functions/resources/ToCSS.md +++ b/content/en/functions/resources/ToCSS.md @@ -10,8 +10,8 @@ action: expiryDate: 2026-06-24 # deprecated 2024-06-24 in v0.128.0 --- -{{% deprecated-in 0.128.0 %}} +{{< deprecated-in 0.128.0 >}} Use [`css.Sass`] instead. [`css.Sass`]: /functions/css/sass/ -{{% /deprecated-in %}} +{{< /deprecated-in >}} diff --git a/content/en/functions/safe/CSS.md b/content/en/functions/safe/CSS.md index 5d67789b6..2e7c0eac7 100644 --- a/content/en/functions/safe/CSS.md +++ b/content/en/functions/safe/CSS.md @@ -51,9 +51,9 @@ Hugo renders the above to:
foo
``` -{{% note %}} +{{< note >}} `ZgotmplZ` is a special value that indicates that unsafe content reached a CSS or URL context at runtime. -{{% /note %}} +{{< /note >}} To declare the string as safe: diff --git a/content/en/functions/safe/URL.md b/content/en/functions/safe/URL.md index e4b3224da..b38d67e59 100644 --- a/content/en/functions/safe/URL.md +++ b/content/en/functions/safe/URL.md @@ -50,9 +50,9 @@ Hugo renders the above to: IRC ``` -{{% note %}} +{{< note >}} `ZgotmplZ` is a special value that indicates that unsafe content reached a CSS or URL context at runtime. -{{% /note %}} +{{< /note >}} To declare the string as safe: diff --git a/content/en/functions/strings/FindRESubmatch.md b/content/en/functions/strings/FindRESubmatch.md index 3feb15bbd..a149f892a 100644 --- a/content/en/functions/strings/FindRESubmatch.md +++ b/content/en/functions/strings/FindRESubmatch.md @@ -85,6 +85,6 @@ https://example.org https://gohugo.io ``` -{{% note %}} +{{< note >}} You can write and test your regular expression using [regex101.com](https://regex101.com/). Be sure to select the Go flavor before you begin. -{{% /note %}} +{{< /note >}} diff --git a/content/en/functions/strings/FindRe.md b/content/en/functions/strings/FindRe.md index 861f38a12..fd2180539 100644 --- a/content/en/functions/strings/FindRe.md +++ b/content/en/functions/strings/FindRe.md @@ -31,6 +31,6 @@ To limit the number of matches to one: {{ findRE `(?s)
```
-{{% note %}}
+{{< note >}}
In the shortcode template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top level context passed into the template.
[`with`]: /functions/go-template/with/
-{{% /note %}}
+{{< /note >}}
diff --git a/content/en/methods/shortcode/Position.md b/content/en/methods/shortcode/Position.md
index 6f047c01b..e3a60a456 100644
--- a/content/en/methods/shortcode/Position.md
+++ b/content/en/methods/shortcode/Position.md
@@ -28,6 +28,6 @@ In the absence of a "greeting" argument, Hugo will throw an error message and fa
ERROR The "myshortcode" shortcode requires a 'greeting' argument. See "/home/user/project/content/about.md:11:1"
```
-{{% note %}}
+{{< note >}}
The position can be expensive to calculate. Limit its use to error reporting.
-{{% /note %}}
+{{< /note >}}
diff --git a/content/en/methods/shortcode/Scratch.md b/content/en/methods/shortcode/Scratch.md
index 6dd882e24..c8be53724 100644
--- a/content/en/methods/shortcode/Scratch.md
+++ b/content/en/methods/shortcode/Scratch.md
@@ -10,7 +10,7 @@ action:
expiryDate: 2026-11-18 # deprecated 2024-11-18 (soft)
---
-{{% deprecated-in 0.139.0 %}}
+{{< deprecated-in 0.139.0 >}}
Use the [`SHORTCODE.Store`] method instead.
This is a soft deprecation. This method will be removed in a future release, but the removal date has not been established. Although Hugo will not emit a warning if you continue to use this method, you should begin using `SHORTCODE.Store` as soon as possible.
@@ -18,4 +18,4 @@ This is a soft deprecation. This method will be removed in a future release, but
Beginning with v0.139.0 the `SHORTCODE.Scratch` method is aliased to `SHORTCODE.Store`.
[`SHORTCODE.Store`]: /methods/shortcode/store/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/shortcode/Store.md b/content/en/methods/shortcode/Store.md
index 8d9a8596b..1517e1f7d 100644
--- a/content/en/methods/shortcode/Store.md
+++ b/content/en/methods/shortcode/Store.md
@@ -18,12 +18,12 @@ toc: true
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.
-{{% note %}}
+{{< note >}}
With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Store` method within a shortcode is mostly obsolete.
[assign values to template variables]: https://go.dev/doc/go1.11#text/template
[`newScratch`]: /functions/collections/newScratch/
-{{% /note %}}
+{{< /note >}}
{{% include "_common/store-methods.md" %}}
diff --git a/content/en/methods/site/BaseURL.md b/content/en/methods/site/BaseURL.md
index ea965a568..239b19a38 100644
--- a/content/en/methods/site/BaseURL.md
+++ b/content/en/methods/site/BaseURL.md
@@ -25,7 +25,7 @@ Template:
{{ .Site.BaseURL }} → https://example.org/docs/
```
-{{% note %}}
+{{< note >}}
There is almost never a good reason to use this method in your templates. Its usage tends to be fragile due to misconfiguration.
Use the [`absURL`], [`absLangURL`], [`relURL`], or [`relLangURL`] functions instead.
@@ -34,4 +34,4 @@ Use the [`absURL`], [`absLangURL`], [`relURL`], or [`relLangURL`] functions inst
[`absLangURL`]: /functions/urls/absLangURL/
[`relURL`]: /functions/urls/relURL/
[`relLangURL`]: /functions/urls/relLangURL/
-{{% /note %}}
+{{< /note >}}
diff --git a/content/en/methods/site/Data.md b/content/en/methods/site/Data.md
index 1021aad7d..16130fb79 100644
--- a/content/en/methods/site/Data.md
+++ b/content/en/methods/site/Data.md
@@ -17,11 +17,11 @@ Use the `Data` method on a `Site` object to access data within the `data` direct
[mounted]: /hugo-modules/configuration/#module-configuration-mounts
-{{% note %}}
+{{< note >}}
Although Hugo can unmarshal CSV files with the [`transform.Unmarshal`] function, do not place CSV files in the `data` directory. You cannot access data within CSV files using this method.
[`transform.Unmarshal`]: /functions/transform/unmarshal/
-{{% /note %}}
+{{< /note >}}
Consider this `data` directory:
diff --git a/content/en/methods/site/DisqusShortname.md b/content/en/methods/site/DisqusShortname.md
index f6fedf4e9..fac1b4f0b 100644
--- a/content/en/methods/site/DisqusShortname.md
+++ b/content/en/methods/site/DisqusShortname.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
-{{% deprecated-in 0.120.0 %}}
+{{< deprecated-in 0.120.0 >}}
Use [`Site.Config.Services.Disqus.Shortname`] instead.
[`Site.Config.Services.Disqus.Shortname`]: /methods/site/config/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/GoogleAnalytics.md b/content/en/methods/site/GoogleAnalytics.md
index f87e1787e..b0633fab9 100644
--- a/content/en/methods/site/GoogleAnalytics.md
+++ b/content/en/methods/site/GoogleAnalytics.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
-{{% deprecated-in 0.120.0 %}}
+{{< deprecated-in 0.120.0 >}}
Use [`Site.Config.Services.GoogleAnalytics.ID`] instead.
[`Site.Config.Services.GoogleAnalytics.ID`]: /methods/site/config/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/IsDevelopment.md b/content/en/methods/site/IsDevelopment.md
index 51783efb9..4ca4069a7 100644
--- a/content/en/methods/site/IsDevelopment.md
+++ b/content/en/methods/site/IsDevelopment.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
-{{% deprecated-in 0.120.0 %}}
+{{< deprecated-in 0.120.0 >}}
Use [`hugo.IsDevelopment`] instead.
[`hugo.IsDevelopment`]: /functions/hugo/isdevelopment/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/IsMultiLingual.md b/content/en/methods/site/IsMultiLingual.md
index 10968f14d..d7b642f8c 100644
--- a/content/en/methods/site/IsMultiLingual.md
+++ b/content/en/methods/site/IsMultiLingual.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2026-03-16 # deprecated 2024-03-16 in 0.124.0
---
-{{% deprecated-in 0.124.0 %}}
+{{< deprecated-in 0.124.0 >}}
Use [`hugo.IsMultilingual`] instead.
[`hugo.IsMultilingual`]: /functions/hugo/ismultilingual/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/IsServer.md b/content/en/methods/site/IsServer.md
index 8fb5b7bf6..6d8817847 100644
--- a/content/en/methods/site/IsServer.md
+++ b/content/en/methods/site/IsServer.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
-{{% deprecated-in 0.120.0 %}}
+{{< deprecated-in 0.120.0 >}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/LastChange.md b/content/en/methods/site/LastChange.md
index f6017df04..0110cf855 100644
--- a/content/en/methods/site/LastChange.md
+++ b/content/en/methods/site/LastChange.md
@@ -10,8 +10,8 @@ action:
expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0
---
-{{% deprecated-in 0.123.0 %}}
+{{< deprecated-in 0.123.0 >}}
Use [`.Site.Lastmod`] instead.
[`.Site.Lastmod`]: /methods/site/lastmod/
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
diff --git a/content/en/methods/site/Menus.md b/content/en/methods/site/Menus.md
index e51980c2e..896d552e3 100644
--- a/content/en/methods/site/Menus.md
+++ b/content/en/methods/site/Menus.md
@@ -13,11 +13,11 @@ action:
The `Menus` method on a `Site` object returns a collection of menus, where each menu contains one or more entries, either flat or nested. Each entry points to a page within the site, or to an external resource.
-{{% note %}}
+{{< note >}}
Menus can be defined and localized in several ways. Please see the [menus] section for a complete explanation and examples.
[menus]: /content-management/menus/
-{{% /note %}}
+{{< /note >}}
A site can have multiple menus. For example, a main menu and a footer menu:
diff --git a/content/en/methods/site/Taxonomies.md b/content/en/methods/site/Taxonomies.md
index ee98d2ac5..cad665d0d 100644
--- a/content/en/methods/site/Taxonomies.md
+++ b/content/en/methods/site/Taxonomies.md
@@ -89,13 +89,13 @@ Hugo renders this to:
```
-{{% note %}}
+{{< note >}}
Hugo's taxonomy system is powerful, allowing you to classify content and create relationships between pages.
Please see the [taxonomies] section for a complete explanation and examples.
[taxonomies]: /content-management/taxonomies/
-{{% /note %}}
+{{< /note >}}
## Examples
diff --git a/content/en/methods/time/AddDate.md b/content/en/methods/time/AddDate.md
index 8537d6e25..a4ef482ed 100644
--- a/content/en/methods/time/AddDate.md
+++ b/content/en/methods/time/AddDate.md
@@ -21,11 +21,11 @@ aliases: [/functions/adddate]
{{ $d.AddDate -1 -1 -1 | time.Format "2006-01-02" }} → 2020-11-30
```
-{{% note %}}
+{{< note >}}
When adding months or years, Hugo normalizes the final `time.Time` value if the resulting day does not exist. For example, adding one month to 31 January produces 2 March or 3 March, depending on the year.
See [this explanation](https://github.com/golang/go/issues/31145#issuecomment-479067967) from the Go team.
-{{% /note %}}
+{{< /note >}}
```go-html-template
{{ $d := "2023-01-31" | time.AsTime }}
diff --git a/content/en/methods/time/Format.md b/content/en/methods/time/Format.md
index 9a718b53b..928af0ee7 100644
--- a/content/en/methods/time/Format.md
+++ b/content/en/methods/time/Format.md
@@ -23,11 +23,11 @@ aliases: [/methods/time/format]
{{ $t.Format $format }} → 27 Jan 2023
```
-{{% note %}}
+{{< note >}}
To [localize](g) the return value, use the [`time.Format`] function instead.
[`time.Format`]: /functions/time/format/
-{{% /note %}}
+{{< /note >}}
Use the `Format` method with any `time.Time` value, including the four predefined front matter dates:
@@ -40,11 +40,11 @@ Use the `Format` method with any `time.Time` value, including the four predefine
{{ .Lastmod.Format $format }}
```
-{{% note %}}
+{{< note >}}
Use the [`time.Format`] function to format string representations of dates, and to format raw TOML dates that exclude time and time zone offset.
[`time.Format`]: /functions/time/format/
-{{% /note %}}
+{{< /note >}}
## Layout string
diff --git a/content/en/render-hooks/_common/pageinner.md b/content/en/render-hooks/_common/pageinner.md
index 6f2622880..96a12bf3b 100644
--- a/content/en/render-hooks/_common/pageinner.md
+++ b/content/en/render-hooks/_common/pageinner.md
@@ -33,11 +33,12 @@ Any render hook triggered while rendering `/posts/p2` will get:
`PageInner` falls back to the value of `Page` if not relevant, and always returns a value.
-{{% note %}}
-The `PageInner` method is only relevant for shortcodes that invoke the [`RenderShortcodes`] method, and you must call the shortcode using the `{{%/*..*/%}}` notation.
+{{< note >}}
+The `PageInner` method is only relevant for shortcodes that invoke the [`RenderShortcodes`] method, and you must call the shortcode using [Markdown notation].
+[Markdown notation]: /content-management/shortcodes/#notation
[`RenderShortcodes`]: /methods/page/rendershortcodes/
-{{% /note %}}
+{{< /note >}}
As a practical example, Hugo's embedded link and image render hooks use the `PageInner` method to resolve markdown link and image destinations. See the source code for each:
diff --git a/content/en/render-hooks/blockquotes.md b/content/en/render-hooks/blockquotes.md
index bdeb06af9..25daf5865 100755
--- a/content/en/render-hooks/blockquotes.md
+++ b/content/en/render-hooks/blockquotes.md
@@ -146,9 +146,9 @@ With the extended Markdown syntax, you may optionally include an alert sign and/
The extended syntax is compatible with [Obsidian].
-{{% note %}}
+{{< note >}}
The extended syntax is not compatible with GitHub or Typora. If you include an alert sign or an alert title, these applications render the Markdown as a blockquote.
-{{% /note %}}
+{{< /note >}}
### Example
diff --git a/content/en/render-hooks/code-blocks.md b/content/en/render-hooks/code-blocks.md
index 7999dbeb8..9622c3883 100755
--- a/content/en/render-hooks/code-blocks.md
+++ b/content/en/render-hooks/code-blocks.md
@@ -48,9 +48,9 @@ In the example above, the _highlighting options_ are `lineNos` and `tabWidth`. H
[Chroma]: https://github.com/alecthomas/chroma/
[highlighting options]: /functions/transform/highlight/#options
-{{% note %}}
+{{< note >}}
Although `style` is a global HTML attribute, when used in an info string it is a highlighting option.
-{{% /note %}}
+{{< /note >}}
## Context
diff --git a/content/en/render-hooks/images.md b/content/en/render-hooks/images.md
index 63f294081..e0e5ce99b 100755
--- a/content/en/render-hooks/images.md
+++ b/content/en/render-hooks/images.md
@@ -79,9 +79,9 @@ block = true
## Examples
-{{% note %}}
+{{< note >}}
With inline elements such as images and links, remove leading and trailing whitespace using the `{{‑ ‑}}` delimiter notation to prevent whitespace between adjacent inline elements and text.
-{{% /note %}}
+{{< /note >}}
In its default configuration, Hugo renders Markdown images according to the [CommonMark specification]. To create a render hook that does the same thing:
@@ -135,11 +135,11 @@ enableDefault = true
A custom render hook, even when provided by a theme or module, will override the embedded render hook regardless of the configuration setting above.
-{{% note %}}
+{{< note >}}
The embedded image render hook is automatically enabled for multilingual single-host sites if [duplication of shared page resources] is disabled. This is the default configuration for multilingual single-host sites.
[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
-{{% /note %}}
+{{< /note >}}
The embedded image render hook resolves internal Markdown destinations by looking for a matching [page resource](g), falling back to a matching [global resource](g). Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
diff --git a/content/en/render-hooks/introduction.md b/content/en/render-hooks/introduction.md
index d086c91bb..f332043c5 100755
--- a/content/en/render-hooks/introduction.md
+++ b/content/en/render-hooks/introduction.md
@@ -21,13 +21,13 @@ When rendering Markdown to HTML, render hooks override the conversion. Each rend
- [Passthrough elements](/render-hooks/passthrough)
- [Tables](/render-hooks/tables)
-{{% note %}}
+{{< note >}}
Hugo supports multiple [content formats] including Markdown, HTML, AsciiDoc, Emacs Org Mode, Pandoc, and reStructuredText.
The render hook capability is limited to Markdown. You cannot create render hooks for the other content formats.
[content formats]: /content-management/formats/
-{{% /note %}}
+{{< /note >}}
For example, consider this Markdown:
diff --git a/content/en/render-hooks/links.md b/content/en/render-hooks/links.md
index 89044c662..4c86557ea 100755
--- a/content/en/render-hooks/links.md
+++ b/content/en/render-hooks/links.md
@@ -58,9 +58,9 @@ Link render hook templates receive the following context:
## Examples
-{{% note %}}
+{{< note >}}
With inline elements such as images and links, remove leading and trailing whitespace using the `{{‑ ‑}}` delimiter notation to prevent whitespace between adjacent inline elements and text.
-{{% /note %}}
+{{< /note >}}
In its default configuration, Hugo renders Markdown links according to the [CommonMark specification]. To create a render hook that does the same thing:
@@ -103,11 +103,11 @@ enableDefault = true
A custom render hook, even when provided by a theme or module, will override the embedded render hook regardless of the configuration setting above.
-{{% note %}}
+{{< note >}}
The embedded link render hook is automatically enabled for multilingual single-host sites if [duplication of shared page resources] is disabled. This is the default configuration for multilingual single-host sites.
[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
-{{% /note %}}
+{{< /note >}}
The embedded link render hook resolves internal Markdown destinations by looking for a matching page, falling back to a matching [page resource](g), then falling back to a matching [global resource](g). Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
diff --git a/content/en/shortcodes/comment.md b/content/en/shortcodes/comment.md
index 1600c09d3..c87765a6b 100755
--- a/content/en/shortcodes/comment.md
+++ b/content/en/shortcodes/comment.md
@@ -12,11 +12,11 @@ weight:
expiryDate: 2025-01-22 # deprecated 2025-02-01 in v0.143.0 and immediately removed from the documentation
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `comment` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl comment %}}
-{{% /note %}}
+{{< /note >}}
{{< new-in 0.137.1 />}}
diff --git a/content/en/shortcodes/details.md b/content/en/shortcodes/details.md
index f30f81d75..029429e2d 100755
--- a/content/en/shortcodes/details.md
+++ b/content/en/shortcodes/details.md
@@ -13,11 +13,11 @@ toc: true
{{< new-in 0.140.0 />}}
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `details` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl details %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/shortcodes/figure.md b/content/en/shortcodes/figure.md
index eb98598b6..69aafe894 100755
--- a/content/en/shortcodes/figure.md
+++ b/content/en/shortcodes/figure.md
@@ -11,11 +11,11 @@ weight:
toc: true
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `figure` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl figure %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/shortcodes/gist.md b/content/en/shortcodes/gist.md
index 1c740bccb..8a247be8d 100755
--- a/content/en/shortcodes/gist.md
+++ b/content/en/shortcodes/gist.md
@@ -11,7 +11,7 @@ weight:
expiryDate: 2027-02-01 # deprecated 2025-02-01 in v0.143.0
---
-{{% deprecated-in 0.143.0 %}}
+{{< deprecated-in 0.143.0 >}}
The `gist` shortcode was deprecated in version 0.143.0 and will be removed in a future release. To continue embedding GitHub Gists in your content, you'll need to create a custom shortcode:
1. Create a new file: Create a file named `gist.html` within the `layouts/shortcodes` directory.
@@ -20,7 +20,7 @@ The `gist` shortcode was deprecated in version 0.143.0 and will be removed in a
This will allow you to maintain the functionality of embedding GitHub Gists in your content after the deprecation of the original shortcode.
[original source code]: {{% eturl gist %}}
-{{% /deprecated-in %}}
+{{< /deprecated-in >}}
To display a GitHub gist with this URL:
diff --git a/content/en/shortcodes/highlight.md b/content/en/shortcodes/highlight.md
index 0a35aa4e6..b6ffe547f 100755
--- a/content/en/shortcodes/highlight.md
+++ b/content/en/shortcodes/highlight.md
@@ -11,19 +11,19 @@ weight:
toc: true
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `highlight` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl highlight %}}
-{{% /note %}}
+{{< /note >}}
-{{% note %}}
+{{< note >}}
With the Markdown [content format], the `highlight` shortcode is rarely needed because, by default, Hugo automatically applies syntax highlighting to fenced code blocks.
The primary use case for the `highlight` shortcode in Markdown is to apply syntax highlighting to inline code snippets.
[content format]: /content-management/formats/
-{{% /note %}}
+{{< /note >}}
The `highlight` shortcode calls the [`transform.Highlight`] function which uses the [Chroma] syntax highlighter, supporting over 200 languages with more than 40 [available styles].
diff --git a/content/en/shortcodes/instagram.md b/content/en/shortcodes/instagram.md
index eb2bb7671..ffe739966 100755
--- a/content/en/shortcodes/instagram.md
+++ b/content/en/shortcodes/instagram.md
@@ -11,11 +11,11 @@ weight:
toc: true
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `instagram` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl instagram %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/shortcodes/param.md b/content/en/shortcodes/param.md
index bff659ec1..b7bd31e47 100755
--- a/content/en/shortcodes/param.md
+++ b/content/en/shortcodes/param.md
@@ -10,11 +10,11 @@ menu:
weight:
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `param` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl param %}}
-{{% /note %}}
+{{< /note >}}
The `param` shortcode renders a parameter from front matter, falling back to a site parameter of the same name. The shortcode throws an error if the parameter does not exist.
diff --git a/content/en/shortcodes/qr.md b/content/en/shortcodes/qr.md
index a7a6d92cb..2a82b919f 100755
--- a/content/en/shortcodes/qr.md
+++ b/content/en/shortcodes/qr.md
@@ -13,11 +13,11 @@ toc: true
{{< new-in 0.141.0 />}}
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `qr` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl qr %}}
-{{% /note %}}
+{{< /note >}}
The `qr` shortcode encodes the given text into a [QR code] using the specified options and renders the resulting image.
diff --git a/content/en/shortcodes/ref.md b/content/en/shortcodes/ref.md
index af133447e..e5d7117c8 100755
--- a/content/en/shortcodes/ref.md
+++ b/content/en/shortcodes/ref.md
@@ -10,18 +10,18 @@ menu:
weight:
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `ref` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl ref %}}
-{{% /note %}}
+{{< /note >}}
-{{% note %}}
+{{< note >}}
When working with the Markdown [content format], this shortcode has become largely redundant. Its functionality is now primarily handled by [link render hooks], specifically the embedded one provided by Hugo. This hook effectively addresses all the use cases previously covered by this shortcode.
[content format]: /content-management/formats/
[link render hooks]: /render-hooks/images/#default
-{{% /note %}}
+{{< /note >}}
The `ref` shortcode returns the permalink of the given page reference.
@@ -43,6 +43,8 @@ Rendered:
Post 1
```
-{{% note %}}
-Always use the `{{%/* */%}}` notation when calling this shortcode.
-{{% /note %}}
+{{< note >}}
+Always use [Markdown notation] notation when calling this shortcode.
+
+[Markdown notation]: /content-management/shortcodes/#notation
+{{< /note >}}
diff --git a/content/en/shortcodes/relref.md b/content/en/shortcodes/relref.md
index e98e82919..603427cb1 100755
--- a/content/en/shortcodes/relref.md
+++ b/content/en/shortcodes/relref.md
@@ -10,18 +10,18 @@ menu:
weight:
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `relref` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl relref %}}
-{{% /note %}}
+{{< /note >}}
-{{% note %}}
+{{< note >}}
When working with the Markdown [content format], this shortcode has become largely redundant. Its functionality is now primarily handled by [link render hooks], specifically the embedded one provided by Hugo. This hook effectively addresses all the use cases previously covered by this shortcode.
[content format]: /content-management/formats/
[link render hooks]: /render-hooks/links/
-{{% /note %}}
+{{< /note >}}
The `relref` shortcode returns the relative permalink of the given page reference.
@@ -43,6 +43,8 @@ Rendered:
Post 1
```
-{{% note %}}
-Always use the `{{%/* */%}}` notation when calling this shortcode.
-{{% /note %}}
+{{< note >}}
+Always use [Markdown notation] notation when calling this shortcode.
+
+[Markdown notation]: /content-management/shortcodes/#notation
+{{< /note >}}
diff --git a/content/en/shortcodes/vimeo.md b/content/en/shortcodes/vimeo.md
index 5ecdf5d02..2d852471a 100755
--- a/content/en/shortcodes/vimeo.md
+++ b/content/en/shortcodes/vimeo.md
@@ -11,11 +11,11 @@ weight:
toc: true
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `vimeo` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl vimeo %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/shortcodes/x.md b/content/en/shortcodes/x.md
index e27bc996a..c2f7a58fe 100755
--- a/content/en/shortcodes/x.md
+++ b/content/en/shortcodes/x.md
@@ -13,11 +13,11 @@ toc: true
{{< new-in 0.141.0 />}}
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `x` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl x %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/shortcodes/youtube.md b/content/en/shortcodes/youtube.md
index 546529500..1c356c732 100755
--- a/content/en/shortcodes/youtube.md
+++ b/content/en/shortcodes/youtube.md
@@ -11,11 +11,11 @@ weight:
toc: true
---
-{{% note %}}
+{{< note >}}
To override Hugo's embedded `youtube` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl youtube %}}
-{{% /note %}}
+{{< /note >}}
## Example
diff --git a/content/en/templates/_common/filter-sort-group.md b/content/en/templates/_common/filter-sort-group.md
index 24bbee96e..f4955ef99 100644
--- a/content/en/templates/_common/filter-sort-group.md
+++ b/content/en/templates/_common/filter-sort-group.md
@@ -2,8 +2,8 @@
_comment: Do not remove front matter.
---
-{{% note %}}
+{{< note >}}
The [page collections quick reference guide] describes methods and functions to filter, sort, and group page collections.
[page collections quick reference guide]: /quick-reference/page-collections/
-{{% /note %}}
+{{< /note >}}
diff --git a/content/en/templates/base.md b/content/en/templates/base.md
index 45320e3cf..b7e73378c 100644
--- a/content/en/templates/base.md
+++ b/content/en/templates/base.md
@@ -66,7 +66,7 @@ The default list template will inherit all of the code defined above and can the
This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
-{{% note %}}
+{{< note >}}
Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
```go-html-template
@@ -76,7 +76,7 @@ Code that you put outside the block definitions *can* break your layout. This ev
{{ end }}
```
[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
-{{% /note %}}
+{{< /note >}}
The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your default [single template]:
diff --git a/content/en/templates/embedded.md b/content/en/templates/embedded.md
index 2e571256e..059448cb4 100644
--- a/content/en/templates/embedded.md
+++ b/content/en/templates/embedded.md
@@ -14,14 +14,14 @@ aliases: [/templates/internal]
## Disqus
-{{% note %}}
+{{< note >}}
To override Hugo's embedded Disqus template, copy the [source code] to a file with the same name in the `layouts/partials` directory, then call it from your templates using the [`partial`] function:
`{{ partial "disqus.html" . }}`
[`partial`]: /functions/partials/include/
[source code]: {{% eturl disqus %}}
-{{% /note %}}
+{{< /note >}}
Hugo includes an embedded template for [Disqus], a popular commenting system for both static and dynamic websites. To effectively use Disqus, secure a Disqus "shortname" by [signing up] for the free service.
@@ -66,14 +66,14 @@ disable
## Google Analytics
-{{% note %}}
+{{< note >}}
To override Hugo's embedded Google Analytics template, copy the [source code] to a file with the same name in the `layouts/partials` directory, then call it from your templates using the [`partial`] function:
`{{ partial "google_analytics.html" . }}`
[`partial`]: /functions/partials/include/
[source code]: {{% eturl google_analytics %}}
-{{% /note %}}
+{{< /note >}}
Hugo includes an embedded template supporting [Google Analytics 4].
@@ -110,14 +110,14 @@ respectDoNotTrack
## Open Graph
-{{% note %}}
+{{< note >}}
To override Hugo's embedded Open Graph template, copy the [source code] to a file with the same name in the `layouts/partials` directory, then call it from your templates using the [`partial`] function:
`{{ partial "opengraph.html" . }}`
[`partial`]: /functions/partials/include/
[source code]: {{% eturl opengraph %}}
-{{% /note %}}
+{{< /note >}}
Hugo includes an embedded template for the [Open Graph protocol](https://ogp.me/), metadata that enables a page to become a rich object in a social graph.
This format is used for Facebook and some other sites.
@@ -169,14 +169,14 @@ If using YouTube this will produce a og:video tag like `}}
Hugo includes an embedded template to render [microdata] `meta` elements within the `head` element of your templates.
@@ -190,14 +190,14 @@ To include the embedded template:
## X (Twitter) Cards
-{{% note %}}
+{{< note >}}
To override Hugo's embedded Twitter Cards template, copy the [source code] to a file with the same name in the `layouts/partials` directory, then call it from your templates using the [`partial`] function:
`{{ partial "twitter_cards.html" . }}`
[`partial`]: /functions/partials/include/
[source code]: {{% eturl twitter_cards %}}
-{{% /note %}}
+{{< /note >}}
Hugo includes an embedded template for [X (Twitter) Cards](https://developer.x.com/en/docs/twitter-for-websites/cards/overview/abouts-cards),
metadata used to attach rich media to Tweets linking to your site.
diff --git a/content/en/templates/home.md b/content/en/templates/home.md
index 18114eb0f..22f71420c 100644
--- a/content/en/templates/home.md
+++ b/content/en/templates/home.md
@@ -33,9 +33,9 @@ Hugo's [template lookup order] determines the template path, allowing you to cre
[template lookup order]: /templates/lookup-order/#home-templates
-{{% note %}}
+{{< note >}}
You must have thorough understanding of the template lookup order when creating templates. Template selection is based on template type, page kind, content type, section, language, and output format.
-{{% /note %}}
+{{< /note >}}
## Content and front matter
diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md
index b68ecf925..2635ebc59 100644
--- a/content/en/templates/introduction.md
+++ b/content/en/templates/introduction.md
@@ -19,7 +19,7 @@ A template is a file in the `layouts` directory of a project, theme, or module.
[methods]: /methods/
[variables]: #variables
-{{% note %}}
+{{< note >}}
Hugo uses Go's [text/template] and [html/template] packages.
The text/template package implements data-driven templates for generating textual output, while the html/template package implements data-driven templates for generating HTML output safe against code injection.
@@ -28,7 +28,7 @@ By default, Hugo uses the html/template package when rendering HTML files.
[text/template]: https://pkg.go.dev/text/template
[html/template]: https://pkg.go.dev/html/template
-{{% /note %}}
+{{< /note >}}
For example, this HTML template initializes the `$v1` and `$v2` variables, then displays them and their product within an HTML paragraph.
@@ -103,9 +103,9 @@ Hugo renders this to:
My Page Title - foo
``` -{{% note %}} +{{< note >}} Make sure that you thoroughly understand the concept of _context_ before you continue reading. The most common templating errors made by new users relate to context. -{{% /note %}} +{{< /note >}} ## Actions @@ -178,9 +178,9 @@ These are also equivalent: {{ 5 | add 2 | mul 6 }} → 42 ``` -{{% note %}} +{{< note >}} Remember that the piped value becomes the final argument to the function or method to which you are piping. -{{% /note %}} +{{< /note >}} ### Line splitting @@ -235,9 +235,9 @@ With variables that represent a slice or map, use the [`index`] function to retu {{ index $map "c" }} → baz ``` -{{% note %}} +{{< note >}} Slices and arrays are zero-based; element 0 is the first element. -{{% /note %}} +{{< /note >}} With variables that represent a map or object, [chain](g) identifiers to return the desired value or to access the desired method. @@ -249,9 +249,9 @@ With variables that represent a map or object, [chain](g) identifiers to return {{ $homePage.Title }} → My Homepage ``` -{{% note %}} +{{< note >}} As seen above, object and method names are capitalized. Although not required, to avoid confusion we recommend beginning variable and map key names with a lowercase letter or underscore. -{{% /note %}} +{{< /note >}} ## Functions @@ -323,11 +323,11 @@ Some methods take an argument. Separate the argument from the method with a spac ## Comments -{{% note %}} +{{< note >}} Do not attempt to use HTML comment delimiters to comment out template code. Hugo strips HTML comments when rendering a page, but first evaluates any template code within the HTML comment delimiters. Depending on the template code within the HTML comment delimiters, this could cause unexpected results or fail the build. -{{% /note %}} +{{< /note >}} Template comments are similar to template actions. Paired opening and closing braces represent the beginning and end of a comment. For example: @@ -389,9 +389,9 @@ Use the [`partial`] or [`partialCached`] function to include one or more [partia Create your partial templates in the layouts/partials directory. -{{% note %}} +{{< note >}} In the examples above, note that we are passing the current context (the dot) to each of the templates. -{{% /note %}} +{{< /note >}} ## Examples diff --git a/content/en/templates/lookup-order.md b/content/en/templates/lookup-order.md index c1a7b2676..926cbd84d 100644 --- a/content/en/templates/lookup-order.md +++ b/content/en/templates/lookup-order.md @@ -36,9 +36,9 @@ Type Section : Is relevant for `section`, `taxonomy` and `term` types. -{{% note %}} +{{< note >}} Templates can live in either the project's or the themes' `layout` directories, and the most specific templates will be chosen. Hugo will interleave the lookups listed below, finding the most specific one either in the project or themes. -{{% /note %}} +{{< /note >}} ## Target a template diff --git a/content/en/templates/output-formats.md b/content/en/templates/output-formats.md index c81a81264..8d0d200ed 100644 --- a/content/en/templates/output-formats.md +++ b/content/en/templates/output-formats.md @@ -53,9 +53,9 @@ These media types are configured for your output formats. If you want to redefin mediaType = "text/html" {{ code-toggle >}} -{{% note %}} +{{< note >}} For the above to work, you also need to add an `outputs` definition in your site configuration. -{{% /note %}} +{{< /note >}} ## Output format definitions diff --git a/content/en/templates/pagination.md b/content/en/templates/pagination.md index 674c6a565..9b1fdcd5e 100644 --- a/content/en/templates/pagination.md +++ b/content/en/templates/pagination.md @@ -20,9 +20,9 @@ Displaying a large page collection on a list page is not user-friendly: Improve usability by paginating `home`, `section`, `taxonomy`, and `term` pages. -{{% note %}} +{{< note >}} The most common templating mistake related to pagination is invoking pagination more than once for a given list page. See the [caching](#caching) section below. -{{% /note %}} +{{< /note >}} ## Terminology @@ -137,9 +137,9 @@ In the example above, we: ## Caching -{{% note %}} +{{< note >}} The most common templating mistake related to pagination is invoking pagination more than once for a given list page. -{{% /note %}} +{{< /note >}} Regardless of pagination method, the initial invocation is cached and cannot be changed. If you invoke pagination more than once for a given list page, subsequent invocations use the cached result. This means that subsequent invocations will not behave as written. @@ -189,14 +189,14 @@ The `terse` format has fewer controls and page slots, consuming less space when {{ template "_internal/pagination.html" (dict "page" . "format" "terse") }} ``` -{{% note %}} +{{< note >}} To override Hugo's embedded pagination template, copy the [source code] to a file with the same name in the `layouts/partials` directory, then call it from your templates using the [`partial`] function: `{{ partial "pagination.html" . }}` [`partial`]: /functions/partials/include/ [source code]: {{% eturl pagination %}} -{{% /note %}} +{{< /note >}} Create custom navigation components using any of the `Pager` methods: diff --git a/content/en/templates/partial.md b/content/en/templates/partial.md index 996914b05..acf36d76c 100644 --- a/content/en/templates/partial.md +++ b/content/en/templates/partial.md @@ -39,13 +39,13 @@ All partials are called within your templates using the following pattern: {{ partial "- {{ $text }} -
+ {{ $text }}New in v%s.
%s` - $href $version (. | $.Page.RenderString (dict "display" "block")) - }} - + {{- $inner := strings.TrimSpace . }} + {{- $text := printf "New in [v%s](%s)\n\n%s" $version $href $inner | $.Page.RenderString (dict "display" "block") }} {{ partial "layouts/blocks/alert.html" (dict - "text" ($text | safeHTML) "color" "green" "icon" "exclamation" + "text" $text ) }} {{- else }} @@ -62,5 +61,5 @@ Some descriptive text here. {{- end }} {{- end }} {{- else }} - {{- errorf "The %q shortcode requires a positional parameter (version). See %s" .Name .Position }} -{{- end -}} + {{- errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }} +{{- end }} diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html index b18d53bc7..564480df3 100644 --- a/layouts/shortcodes/note.html +++ b/layouts/shortcodes/note.html @@ -1,7 +1,18 @@ -{{ $_hugo_config := `{ "version": 1 }` }} -{{ partial "layouts/blocks/alert.html" (dict - "text" .Inner +{{- /* + Renders a callout. + + @returns {template.HTML} + + @examples + + {{< note >}} + Some descriptive text here. + {{< /note >}} +*/}} +{{- $text := .Inner | strings.TrimSpace | .Page.RenderString (dict "display" "block") }} +{{- partial "layouts/blocks/alert.html" (dict "color" "blue" "icon" "exclamation" + "text" $text ) }}