]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Merge commit '838bd312b1a287bb33962ad478dbc54737654f35'
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 18 Nov 2024 09:11:18 +0000 (10:11 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 18 Nov 2024 09:11:18 +0000 (10:11 +0100)
1  2 
docs/content/en/content-management/archetypes.md
docs/content/en/content-management/mathematics.md
docs/content/en/functions/lang/FormatNumberCustom.md
docs/content/en/getting-started/configuration-markup.md
docs/content/en/hugo-pipes/transpile-sass-to-css.md
docs/content/en/methods/duration/Truncate.md
docs/content/en/methods/shortcode/Inner.md

index f89c3f6b3854bd3557136399fb29851312ee48e9,0000000000000000000000000000000000000000..acf101fda15d35e68cfe16e92c0f3c9552350f2c
mode 100644,000000..100644
--- /dev/null
@@@ -1,203 -1,0 +1,203 @@@
- ## Alternate date format
 +---
 +title: Archetypes
 +description: An archetype is a template for new content.
 +categories: [content management]
 +keywords: [archetypes,generators,metadata,front matter]
 +menu:
 +  docs:
 +    parent: content-management
 +    weight: 140
 +  quicklinks:
 +weight: 140
 +toc: true
 +aliases: [/content/archetypes/]
 +---
 +
 +## Overview
 +
 +A content file consists of [front matter] and markup. The markup is typically Markdown, but Hugo also supports other [content formats]. Front matter can be TOML, YAML, or JSON.
 +
 +The `hugo new content` command creates a new file in the `content` directory, using an archetype as a template. This is the default archetype:
 +
 +{{< code-toggle file=archetypes/default.md fm=true >}}
 +title = '{{ replace .File.ContentBaseName `-` ` ` | title }}'
 +date = '{{ .Date }}'
 +draft = true
 +{{< /code-toggle >}}
 +
 +When you create new content, Hugo evaluates the [template actions] within the archetype. For example:
 +
 +```sh
 +hugo new content posts/my-first-post.md
 +```
 +
 +With the default archetype shown above, Hugo creates this content file:
 +
 +{{< code-toggle file=content/posts/my-first-post.md fm=true >}}
 +title = 'My First Post'
 +date = '2023-08-24T11:49:46-07:00'
 +draft = true
 +{{< /code-toggle >}}
 +
 +You can create an archetype for one or more [content types]. For example, use one archetype for posts, and use the default archetype for everything else:
 +
 +```text
 +archetypes/
 +├── default.md
 +└── posts.md
 +```
 +
 +## Lookup order
 +
 +Hugo looks for archetypes in the `archetypes` directory in the root of your project, falling back to the `archetypes` directory in themes or installed modules. An archetype for a specific content type takes precedence over the default archetype.
 +
 +For example, with this command:
 +
 +```sh
 +hugo new content posts/my-first-post.md
 +```
 +
 +The archetype lookup order is:
 +
 +1. archetypes/posts.md
 +1. archetypes/default.md
 +1. themes/my-theme/archetypes/posts.md
 +1. themes/my-theme/archetypes/default.md
 +
 +If none of these exists, Hugo uses a built-in default archetype.
 +
 +## Functions and context
 +
 +You can use any [template function] within an archetype. As shown above, the default archetype uses the [`replace`](/functions/strings/replace) function to replace hyphens with spaces when populating the title in front matter.
 +
 +Archetypes receive the following [context]:
 +
 +Date
 +: (`string`) The current date and time, formatted in compliance with RFC3339.
 +
 +File
 +: (`hugolib.fileInfo`) Returns file information for the current page. See [details](/methods/page/file).
 +
 +Type
 +: (`string`) The [content type] inferred from the top-level directory name, or as specified by the `--kind` flag passed to the `hugo new content` command.
 +
 +[content type]: /getting-started/glossary#content-type
 +
 +Site
 +: (`page.Site`) The current site object. See [details](/methods/site/).
 +
- To insert date and time with an alternate format, use the [`time.Now`] function:
++## Date format
 +
- ## Use alternate archetype
++To insert date and time with a different format, use the [`time.Now`] function:
 +
 +[`time.Now`]: /functions/time/now/
 +
 +{{< code-toggle file=archetypes/default.md fm=true >}}
 +title = '{{ replace .File.ContentBaseName `-` ` ` | title }}'
 +date = '{{ time.Now.Format "2006-01-02" }}'
 +draft = true
 +{{< /code-toggle >}}
 +
 +## Include content
 +
 +Although typically used as a front matter template, you can also use an archetype to populate content.
 +
 +For example, in a documentation site you might have a section (content type) for functions. Every page within this section should follow the same format: a brief description, the function signature, examples, and notes. We can pre-populate the page to remind content authors of the standard format.
 +
 +{{< code file=archetypes/functions.md >}}
 +---
 +date: '{{ .Date }}'
 +draft: true
 +title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
 +---
 +
 +A brief description of what the function does, using simple present tense in the third person singular form. For example:
 +
 +`someFunction` returns the string `s` repeated `n` times.
 +
 +## Signature
 +
 +```text
 +func someFunction(s string, n int) string
 +```
 +
 +## Examples
 +
 +One or more practical examples, each within a fenced code block.
 +
 +## Notes
 +
 +Additional information to clarify as needed.
 +{{< /code >}}
 +
 +Although you can include [template actions] within the content body, remember that Hugo evaluates these once---at the time of content creation. In most cases, place template actions in a [template] where Hugo evaluates the actions every time you [build](/getting-started/glossary/#build) the site.
 +
 +## Leaf bundles
 +
 +You can also create archetypes for [leaf bundles](/getting-started/glossary/#leaf-bundle).
 +
 +For example, in a photography site you might have a section (content type) for galleries. Each gallery is leaf bundle with content and images.
 +
 +Create an archetype for galleries:
 +
 +```text
 +archetypes/
 +├── galleries/
 +│   ├── images/
 +│   │   └── .gitkeep
 +│   └── index.md      <-- same format as default.md
 +└── default.md
 +```
 +
 +Subdirectories within an archetype must contain at least one file. Without a file, Hugo will not create the subdirectory when you create new content. The name and size of the file are irrelevant. The example above includes a&nbsp;`.gitkeep` file, an empty file commonly used to preserve otherwise empty directories in a Git repository.
 +
 +To create a new gallery:
 +
 +```sh
 +hugo new galleries/bryce-canyon
 +```
 +
 +This produces:
 +
 +```text
 +content/
 +├── galleries/
 +│   └── bryce-canyon/
 +│       ├── images/
 +│       │   └── .gitkeep
 +│       └── index.md
 +└── _index.md
 +```
 +
- Use the `--kind` command line flag to specify an alternate archetype when creating content.
++## Specify archetype
 +
++Use the `--kind` command line flag to specify an archetype when creating content.
 +
 +For example, let's say your site has two sections: articles and tutorials. Create an archetype for each content type:
 +
 +```text
 +archetypes/
 +├── articles.md
 +├── default.md
 +└── tutorials.md
 +```
 +
 +To create an article using the articles archetype:
 +
 +```sh
 +hugo new content articles/something.md
 +```
 +
 +To create an article using the tutorials archetype:
 +
 +```sh
 +hugo new content --kind tutorials articles/something.md
 +```
 +
 +[content formats]: /getting-started/glossary/#content-format
 +[content types]: /getting-started/glossary/#content-type
 +[context]: /getting-started/glossary/#context
 +[front matter]: /getting-started/glossary/#front-matter
 +[template actions]: /getting-started/glossary/#template-action
 +[template]: /getting-started/glossary/#template
 +[template function]: /getting-started/glossary/#function
index a01a166dce1b944b24e4886c9f0e07218809eb25,0000000000000000000000000000000000000000..3212fe251c16d76eafc9137f1ceb695d5f3a2226
mode 100644,000000..100644
--- /dev/null
@@@ -1,228 -1,0 +1,228 @@@
- These are block equations using alternate delimiters:
 +---
 +title: Mathematics in Markdown
 +linkTitle: Mathematics
 +description: Include mathematical equations and expressions in your Markdown using LaTeX or TeX typesetting syntax.
 +categories: [content management]
 +keywords: [chemical,chemistry,latex,math,mathjax,tex,typesetting]
 +menu:
 +  docs:
 +    parent: content-management
 +    weight: 270
 +weight: 270
 +toc: true
 +math: true
 +---
 +
 +{{< new-in 0.122.0 >}}
 +
 +\[
 +\begin{aligned}
 +KL(\hat{y} || y) &= \sum_{c=1}^{M}\hat{y}_c \log{\frac{\hat{y}_c}{y_c}} \\
 +JS(\hat{y} || y) &= \frac{1}{2}(KL(y||\frac{y+\hat{y}}{2}) + KL(\hat{y}||\frac{y+\hat{y}}{2}))
 +\end{aligned}
 +\]
 +
 +## Overview
 +
 +Mathematical equations and expressions authored in [LaTeX] or [TeX] are common in academic and scientific publications. Your browser typically renders this mathematical markup using an open-source JavaScript display engine such as [MathJax] or [KaTeX].
 +
 +For example, this is the mathematical markup for the equations displayed at the top of this page:
 +
 +```text
 +\[
 +\begin{aligned}
 +KL(\hat{y} || y) &= \sum_{c=1}^{M}\hat{y}_c \log{\frac{\hat{y}_c}{y_c}} \\
 +JS(\hat{y} || y) &= \frac{1}{2}(KL(y||\frac{y+\hat{y}}{2}) + KL(\hat{y}||\frac{y+\hat{y}}{2}))
 +\end{aligned}
 +\]
 +```
 +
 +Equations and expressions can be displayed inline with other text, or as standalone blocks. Block presentation is also known as "display" mode.
 +
 +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. Common delimiter pairs are shown in [Step 1].
 +
 +The approach described below avoids reliance on platform-specific features like shortcodes or code block render hooks. Instead, it utilizes a standardized markup format for mathematical equations and expressions, compatible with the rendering engines used by GitHub, GitLab, [Microsoft VS Code], [Obsidian], [Typora], and others.
 +
 +## Setup
 +
 +Follow these instructions to include mathematical equations and expressions in your Markdown using LaTeX or TeX typesetting syntax.
 +
 +###### Step 1
 +
 +Enable and configure the Goldmark [passthrough extension] in your site configuration. The passthrough extension preserves raw Markdown within delimited snippets of text, including the delimiters themselves.
 +
 +{{< code-toggle file=hugo copy=true >}}
 +[markup.goldmark.extensions.passthrough]
 +enable = true
 +
 +[markup.goldmark.extensions.passthrough.delimiters]
 +block = [['\[', '\]'], ['$$', '$$']]
 +inline = [['\(', '\)']]
 +
 +[params]
 +math = true
 +{{< /code-toggle >}}
 +
 +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 %}}
 +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 %}}
 +
 +To disable passthrough of inline snippets, omit the `inline` key from the configuration:
 +
 +{{< code-toggle file=hugo >}}
 +[markup.goldmark.extensions.passthrough.delimiters]
 +block = [['\[', '\]'], ['$$', '$$']]
 +{{< /code-toggle >}}
 +
 +You can define your own opening and closing delimiters, provided they match the delimiters that you set in [Step 2].
 +
 +{{< code-toggle file=hugo >}}
 +[markup.goldmark.extensions.passthrough.delimiters]
 +block = [['@@', '@@']]
 +inline = [['@', '@']]
 +{{< /code-toggle >}}
 +
 +###### Step 2
 +
 +Create a partial template to load MathJax or KaTeX. The example below loads MathJax, or you can use KaTeX as described in the [engines](#engines) section.
 +
 +{{< code file=layouts/partials/math.html copy=true >}}
 +<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
 +<script>
 +  MathJax = {
 +    tex: {
 +      displayMath: [['\\[', '\\]'], ['$$', '$$']],  // block
 +      inlineMath: [['\\(', '\\)']]                  // inline
 +    }
 +  };
 +</script>
 +{{< /code >}}
 +
 +The delimiters above must match the delimiters in your site configuration.
 +
 +###### Step 3
 +
 +Conditionally call the partial template from the base template.
 +
 +{{< code file=layouts/_default/baseof.html >}}
 +<head>
 +  ...
 +  {{ if .Param "math" }}
 +    {{ partialCached "math.html" . }}
 +  {{ end }}
 +  ...
 +</head>
 +{{< /code >}}
 +
 +The example above loads the partial template if you have set the `math` parameter in front matter to `true`. If you have not set the `math` parameter in front matter, the conditional statement falls back to the `math` parameter in your site configuration.
 +
 +###### Step 4
 +
 +Include mathematical equations and expressions in your Markdown using LaTeX or TeX typesetting syntax.
 +
 +{{< code file=content/math-examples.md copy=true >}}
 +This is an inline \(a^*=x-b^*\) equation.
 +
 +These are block equations:
 +
 +\[a^*=x-b^*\]
 +
 +\[ a^*=x-b^* \]
 +
 +\[
 +a^*=x-b^*
 +\]
 +
++These are also block equations:
 +
 +$$a^*=x-b^*$$
 +
 +$$ a^*=x-b^* $$
 +
 +$$
 +a^*=x-b^*
 +$$
 +{{< /code >}}
 +
 +If you set the `math` parameter to `false` in your site configuration, you must set the `math` parameter to `true` in front matter. For example:
 +
 +{{< code-toggle file=content/math-examples.md fm=true >}}
 +title = 'Math examples'
 +date = 2024-01-24T18:09:49-08:00
 +[params]
 +math = true
 +{{< /code-toggle >}}
 +
 +## Inline delimiters
 +
 +The configuration, JavaScript, and examples above use the `\(...\)` delimiter pair for inline equations. The `$...$` delimiter pair is a common alternative, but using it may result in unintended formatting if you use the `$` symbol outside of math contexts.
 +
 +If you add the `$...$` delimiter pair to your configuration and JavaScript, you must double-escape the `$` when outside of math contexts, regardless of whether mathematical rendering is enabled on the page. For example:
 +
 +```text
 +A \\$5 bill _saved_ is a \\$5 bill _earned_.
 +```
 +
 +{{% note %}}
 +If you use the `$...$` delimiter pair for inline equations, and occasionally use the&nbsp;`$`&nbsp;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 %}}
 +
 +## 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.9.
 +
 +{{% note %}}
 +If you use the `$...$` delimiter pair for inline equations, and occasionally use the&nbsp;`$`&nbsp;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 %}}
 +
 +To use KaTeX instead of MathJax, replace the partial template from [Step 2] with this:
 +
 +{{< code file=layouts/partials/math.html copy=true >}}
 +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
 +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
 +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
 +<script>
 +  document.addEventListener("DOMContentLoaded", function() {
 +    renderMathInElement(document.body, {
 +      delimiters: [
 +        {left: '\\[', right: '\\]', display: true},   // block
 +        {left: '$$', right: '$$', display: true},     // block
 +        {left: '\\(', right: '\\)', display: false},  // inline
 +      ],
 +      throwOnError : false
 +    });
 +  });
 +</script>
 +{{< /code >}}
 +
 +The delimiters above must match the delimiters in your site configuration.
 +
 +## Chemistry
 +
 +Both MathJax and KaTeX provide support for chemical equations. For example:
 +
 +```text
 +$$C_p[\ce{H2O(l)}] = \pu{75.3 J // mol K}$$
 +```
 +
 +$$C_p[\ce{H2O(l)}] = \pu{75.3 J // mol K}$$
 +
 +As shown in [Step 2] above, MathJax supports chemical equations without additional configuration. To add chemistry support to KaTeX, enable the mhchem extension as described in the KaTeX [documentation](https://katex.org/docs/libs).
 +
 +[KaTeX]: https://katex.org/
 +[LaTeX]: https://www.latex-project.org/
 +[MathJax]: https://www.mathjax.org/
 +[Microsoft VS Code]: https://code.visualstudio.com/
 +[Obsidian]: https://obsidian.md/
 +[Step 1]: #step-1
 +[Step 2]: #step-2
 +[Step 3]: #step-3
 +[TeX]: https://en.wikipedia.org/wiki/TeX
 +[Typora]: https://typora.io/
 +[passthrough extension]: https://github.com/gohugoio/hugo-goldmark-extensions
index 5b24aa2c1169825b1f440e0a61fe6a8ca2c5e831,0000000000000000000000000000000000000000..603f42087139c660436ce387a382dc0110811e6f
mode 100644,000000..100644
--- /dev/null
@@@ -1,34 -1,0 +1,34 @@@
- This function formats a number with the given precision. The first options parameter is a space-delimited string of characters to represent negativity, the decimal point, and grouping. The default value is `- . ,`. The second options parameter defines an alternate delimiting character.
 +---
 +title: lang.FormatNumberCustom
 +description: Returns a numeric representation of a number with the given precision using negative, decimal, and grouping options.
 +categories: []
 +keywords: []
 +action:
 +  aliases: []
 +  related:
 +    - functions/lang/FormatAccounting
 +    - functions/lang/FormatCurrency
 +    - functions/lang/FormatNumber
 +    - functions/lang/FormatPercent
 +  returnType: string
 +  signatures: ['lang.FormatNumberCustom PRECISION NUMBER [OPTIONS...]']
 +aliases: ['/functions/numfmt/']
 +---
 +
++This function formats a number with the given precision. The first options parameter is a space-delimited string of characters to represent negativity, the decimal point, and grouping. The default value is `- . ,`. The second options parameter defines an alternative delimiting character.
 +
 +Note that numbers are rounded up at 5 or greater. So, with precision set to 0, 1.5 becomes 2, and 1.4 becomes&nbsp;1.
 +
 +For a simpler function that adapts to the current language, see [`lang.FormatNumber`].
 +
 +```go-html-template
 +{{ lang.FormatNumberCustom 2 12345.6789 }} → 12,345.68
 +{{ lang.FormatNumberCustom 2 12345.6789 "- , ." }} → 12.345,68
 +{{ lang.FormatNumberCustom 6 -12345.6789 "- ." }} → -12345.678900
 +{{ lang.FormatNumberCustom 0 -12345.6789 "- . ," }} → -12,346
 +{{ lang.FormatNumberCustom 0 -12345.6789 "-|.| " "|" }} → -12 346
 +```
 +
 +{{% include "functions/_common/locales.md" %}}
 +
 +[`lang.FormatNumber`]: /functions/lang/formatnumber/
index bcc997519276cb4424ab1f9aeca0af535c30232b,0000000000000000000000000000000000000000..3853a3a6a26c66439f16d69ab5a5f0dd0ff00c47
mode 100644,000000..100644
--- /dev/null
@@@ -1,387 -1,0 +1,387 @@@
- Files with the `.md` or `.markdown` extension are processed as Markdown, provided that you have not specified a different [content format] using the `markup` field in front matter.
 +---
 +title: Configure markup
 +description: Configure rendering of markup to HTML.
 +categories: [getting started,fundamentals]
 +keywords: [markup,markdown,goldmark,asciidoc,asciidoctor,highlighting]
 +menu:
 +  docs:
 +    parent: getting-started
 +    weight: 50
 +weight: 50
 +slug: configuration-markup
 +toc: true
 +---
 +
 +## Default handler
 +
 +Hugo uses [Goldmark] to render Markdown to HTML.
 +
 +{{< code-toggle file=hugo >}}
 +[markup]
 +defaultMarkdownHandler = 'goldmark'
 +{{< /code-toggle >}}
 +
- Unless you need a unique capability provided by one of the alternate Markdown handlers, we strongly recommend that you use the default setting. Goldmark is fast, well maintained, conforms to the [CommonMark] specification, and is compatible with [GitHub Flavored Markdown] (GFM).
++Files with a `.md`, `.mdown`, or `.markdown` extension are processed as Markdown, provided that you have not specified a different [content format] using the `markup` field in front matter.
 +
 +To use a different renderer for Markdown files, specify one of `asciidocext`, `org`, `pandoc`, or `rst` in your site configuration.
 +
 +defaultMarkdownHandler|Description
 +:--|:--
 +`asciidocext`|[AsciiDoc]
 +`goldmark`|[Goldmark]
 +`org`|[Emacs Org Mode]
 +`pandoc`|[Pandoc]
 +`rst`|[reStructuredText]
 +
 +To use AsciiDoc, Pandoc, or reStructuredText you must install the relevant renderer and update your [security policy].
 +
 +{{% note %}}
++Unless you need a unique capability provided by one of the alternative Markdown handlers, we strongly recommend that you use the default setting. Goldmark is fast, well maintained, conforms to the [CommonMark] specification, and is compatible with [GitHub Flavored Markdown] (GFM).
 +
 +[commonmark]: https://spec.commonmark.org/0.30/
 +[github flavored markdown]: https://github.github.com/gfm/
 +{{% /note %}}
 +
 +[asciidoc]: https://asciidoc.org/
 +[content format]: /content-management/formats/#formats
 +[emacs org mode]: https://orgmode.org/
 +[goldmark]: https://github.com/yuin/goldmark/
 +[pandoc]: https://pandoc.org/
 +[restructuredtext]: https://docutils.sourceforge.io/rst.html
 +[security policy]: /about/security/#security-policy
 +
 +## Goldmark
 +
 +This is the default configuration for the Goldmark Markdown renderer:
 +
 +{{< code-toggle config=markup.goldmark />}}
 +
 +### Goldmark extensions
 +
 +The extensions below, excluding Extras and Passthrough, are enabled by default.
 +
 +Extension|Documentation|Enabled
 +:--|:--|:-:
 +cjk|[Goldmark Extensions: CJK]|:heavy_check_mark:
 +definitionList|[PHP Markdown Extra: Definition lists]|:heavy_check_mark:
 +extras|[Hugo Goldmark Extensions: Extras]|
 +footnote|[PHP Markdown Extra: Footnotes]|:heavy_check_mark:
 +linkify|[GitHub Flavored Markdown: Autolinks]|:heavy_check_mark:
 +passthrough|[Hugo Goldmark Extensions: Passthrough]|
 +strikethrough|[GitHub Flavored Markdown: Strikethrough]|:heavy_check_mark:
 +table|[GitHub Flavored Markdown: Tables]|:heavy_check_mark:
 +taskList|[GitHub Flavored Markdown: Task list items]|:heavy_check_mark:
 +typographer|[Goldmark Extensions: Typographer]|:heavy_check_mark:
 +
 +[GitHub Flavored Markdown: Autolinks]: https://github.github.com/gfm/#autolinks-extension-
 +[GitHub Flavored Markdown: Strikethrough]: https://github.github.com/gfm/#strikethrough-extension-
 +[GitHub Flavored Markdown: Tables]: https://github.github.com/gfm/#tables-extension-
 +[GitHub Flavored Markdown: Task list items]: https://github.github.com/gfm/#task-list-items-extension-
 +[Goldmark Extensions: CJK]: https://github.com/yuin/goldmark?tab=readme-ov-file#cjk-extension
 +[Goldmark Extensions: Typographer]: https://github.com/yuin/goldmark?tab=readme-ov-file#typographer-extension
 +[Hugo Goldmark Extensions: Extras]: https://github.com/gohugoio/hugo-goldmark-extensions?tab=readme-ov-file#extras-extension
 +[Hugo Goldmark Extensions: Passthrough]: https://github.com/gohugoio/hugo-goldmark-extensions?tab=readme-ov-file#passthrough-extension
 +[PHP Markdown Extra: Definition lists]: https://michelf.ca/projects/php-markdown/extra/#def-list
 +[PHP Markdown Extra: Footnotes]: https://michelf.ca/projects/php-markdown/extra/#footnotes
 +
 +#### Extras
 +
 +{{< new-in 0.126.0 >}}
 +
 +Enable [deleted text], [inserted text], [mark text], [subscript], and [superscript] elements in Markdown.
 +
 +Element|Markdown|Rendered
 +:--|:--|:--
 +Deleted text|`~~foo~~`|`<del>foo</del>`
 +Inserted text|`++bar++`|`<ins>bar</ins>`
 +Mark text|`==baz==`|`<mark>baz</mark>`
 +Subscript|`H~2~O`|`H<sub>2</sub>O`
 +Superscript|`1^st^`|`1<sup>st</sup>`
 +
 +[deleted text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
 +[inserted text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins
 +[mark text]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
 +[subscript]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
 +[superscript]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup
 +
 +To avoid a conflict when enabling the Hugo Goldmark Extras subscript extension, if you want to render subscript and strikethrough text concurrently you must:
 +
 +1. Disable the Goldmark strikethrough extension
 +2. Enable the Hugo Goldmark Extras delete extension
 +
 +For example:
 +
 +{{< code-toggle file=hugo >}}
 +[markup.goldmark.extensions]
 +strikethrough = false
 +
 +[markup.goldmark.extensions.extras.delete]
 +enable = true
 +
 +[markup.goldmark.extensions.extras.subscript]
 +enable = true
 +{{< /code-toggle >}}
 +
 +#### Passthrough
 +
 +{{< new-in 0.122.0 >}}
 +
 +Enable the passthrough extension to include mathematical equations and expressions in Markdown using LaTeX or TeX typesetting syntax. See [mathematics in Markdown] for details.
 +
 +[mathematics in Markdown]: content-management/mathematics/
 +
 +#### Typographer
 +
 +The Typographer extension replaces certain character combinations with HTML entities as specified below:
 +
 +Markdown|Replaced by|Description
 +:--|:--|:--
 +`...`|`&hellip;`|horizontal ellipsis
 +`'`|`&rsquo;`|apostrophe
 +`--`|`&ndash;`|en dash
 +`---`|`&mdash;`|em dash
 +`«`|`&laquo;`|left angle quote
 +`“`|`&ldquo;`|left double quote
 +`‘`|`&lsquo;`|left single quote
 +`»`|`&raquo;`|right angle quote
 +`”`|`&rdquo;`|right double quote
 +`’`|`&rsquo;`|right single quote
 +
 +### Goldmark settings explained
 +
 +Most of the Goldmark settings above are self-explanatory, but some require explanation.
 +
 +###### duplicateResourceFiles
 +
 +{{< new-in 0.123.0 >}}
 +
 +(`bool`) If `true`, shared page resources on multilingual single-host sites will be duplicated for each language. See [multilingual page resources] for details. Default is `false`.
 +
 +[multilingual page resources]: /content-management/page-resources/#multilingual
 +
 +{{% note %}}
 +With multilingual single-host sites, setting this parameter to `false` will enable Hugo's [embedded link render hook] and [embedded image render hook]. This is the default configuration for multilingual single-host sites.
 +
 +[embedded image render hook]: /render-hooks/images/#default
 +[embedded link render hook]: /render-hooks/links/#default
 +{{% /note %}}
 +
 +###### parser.wrapStandAloneImageWithinParagraph
 +
 +(`bool`) If `true`, image elements without adjacent content will be wrapped within a `p` element when rendered. This is the default Markdown behavior. Set to `false` when using an [image render hook] to render standalone images as `figure` elements. Default is `true`.
 +
 +[image render hook]: /render-hooks/images/
 +
 +###### parser.autoHeadingIDType
 +
 +(`string`) The strategy used to automatically generate heading `id` attributes, one of `github`, `github-ascii` or `blackfriday`.
 +
 +- `github` produces GitHub-compatible `id` attributes
 +- `github-ascii` drops any non-ASCII characters after accent normalization
 +- `blackfriday` produces `id` attributes compatible with the Blackfriday Markdown renderer
 +
 +This is also the strategy used by the [anchorize](/functions/urls/anchorize) template function. Default is `github`.
 +
 +###### parser.attribute.block
 +
 +(`bool`) If `true`, enables [Markdown attributes] for block elements. Default is `false`.
 +
 +[Markdown attributes]: /content-management/markdown-attributes/
 +
 +###### parser.attribute.title
 +
 +(`bool`) If `true`, enables [Markdown attributes] for headings. Default is `true`.
 +
 +###### renderHooks.image.enableDefault
 +
 +{{< new-in 0.123.0 >}}
 +
 +(`bool`) If `true`, enables Hugo's [embedded image render hook]. Default is `false`.
 +
 +[embedded image render hook]: /render-hooks/images/#default
 +
 +{{% 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 %}}
 +
 +###### renderHooks.link.enableDefault
 +
 +{{< new-in 0.123.0 >}}
 +
 +(`bool`) If `true`, enables Hugo's [embedded link render hook]. Default is `false`.
 +
 +[embedded link render hook]: /render-hooks/links/#default
 +
 +{{% 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 %}}
 +
 +###### renderer.hardWraps
 +
 +(`bool`) If `true`, Goldmark replaces newline characters within a paragraph with `br` elements. Default is `false`.
 +
 +###### renderer.unsafe
 +
 +(`bool`) If `true`, Goldmark renders raw HTML mixed within the Markdown. This is unsafe unless the content is under your control. Default is `false`.
 +
 +## AsciiDoc
 +
 +This is the default configuration for the AsciiDoc renderer:
 +
 +{{< code-toggle config=markup.asciidocExt />}}
 +
 +### AsciiDoc settings explained
 +
 +###### attributes
 +
 +(`map`) A map of key-value pairs, each a document attribute. See Asciidoctor’s [attributes].
 +
 +[attributes]: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions
 +
 +###### backend
 +
 +(`string`) The backend output file format. Default is `html5`.
 +
 +###### extensions
 +
 +(`string array`) An array of enabled extensions, one or more of `asciidoctor-html5s`, `asciidoctor-bibtex`, `asciidoctor-diagram`, `asciidoctor-interdoc-reftext`, `asciidoctor-katex`, `asciidoctor-latex`, `asciidoctor-mathematical`, or `asciidoctor-question`.
 +
 +{{% note %}}
 +To mitigate security risks, entries in the extension array may not contain forward slashes (`/`), backslashes (`\`), or periods. Due to this restriction, extensions must be in Ruby's `$LOAD_PATH`.
 +{{% /note %}}
 +
 +###### failureLevel
 +
 +(`string`) The minimum logging level that triggers a non-zero exit code (failure). Default is `fatal`.
 +
 +###### noHeaderOrFooter
 +
 +(`bool`) If `true`, outputs an embeddable document, which excludes the header, the footer, and everything outside the body of the document. Default is `true`.
 +
 +###### preserveTOC
 +
 +(`bool`) If `true`, preserves the table of contents (TOC) rendered by Asciidoctor. By default, to make the TOC compatible with existing themes, Hugo removes the TOC rendered by Asciidoctor. To render the TOC, use the [`TableOfContents`] method on a `Page` object in your templates. Default is `false`.
 +
 +[`TableOfContents`]: /methods/page/tableofcontents/
 +
 +###### safeMode
 +
 +(`string`) The safe mode level, one of `unsafe`, `safe`, `server`, or `secure`. Default is `unsafe`.
 +
 +###### sectionNumbers
 +
 +(`bool`) If `true`, numbers each section title. Default is `false`.
 +
 +###### trace
 +
 +(`bool`) If `true`, include backtrace information on errors. Default is `false`.
 +
 +###### verbose
 +
 +(`bool`)If `true`, verbosely prints processing information and configuration file checks to stderr. Default is `false`.
 +
 +###### workingFolderCurrent
 +
 +(`bool`) If `true`, sets the working directory to be the same as that of the AsciiDoc file being processed, allowing [includes] to work with relative paths. Set to `true` to render diagrams with the [asciidoctor-diagram] extension. Default is `false`.
 +
 +[asciidoctor-diagram]: https://asciidoctor.org/docs/asciidoctor-diagram/
 +[includes]: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#includes
 +
 +### AsciiDoc configuration example
 +
 +{{< code-toggle file=hugo >}}
 +[markup.asciidocExt]
 +    extensions = ["asciidoctor-html5s", "asciidoctor-diagram"]
 +    workingFolderCurrent = true
 +    [markup.asciidocExt.attributes]
 +        my-base-url = "https://example.com/"
 +        my-attribute-name = "my value"
 +{{< /code-toggle >}}
 +
 +### AsciiDoc syntax highlighting
 +
 +Follow the steps below to enable syntax highlighting.
 +
 +Step 1
 +: Set the `source-highlighter` attribute in your site configuration. For example:
 +
 +{{< code-toggle file=hugo >}}
 +[markup.asciidocExt.attributes]
 +source-highlighter = 'rouge'
 +{{< /code-toggle >}}
 +
 +Step 2
 +: Generate the highlighter CSS. For example:
 +
 +```text
 +rougify style monokai.sublime > assets/css/syntax.css
 +```
 +
 +Step 3
 +: In your base template add a link to the CSS file:
 +
 +{{< code file=layouts/_default/baseof.html >}}
 +<head>
 +  ...
 +  {{ with resources.Get "css/syntax.css" }}
 +    <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
 +  {{ end }}
 +  ...
 +</head>
 +{{< /code >}}
 +
 +Then add the code to be highlighted to your markup:
 +
 +```text
 +[#hello,ruby]
 +----
 +require 'sinatra'
 +
 +get '/hi' do
 +  "Hello World!"
 +end
 +----
 +```
 +
 +### AsciiDoc troubleshooting
 +
 +Run `hugo --logLevel debug` to examine Hugo's call to the Asciidoctor executable:
 +
 +```txt
 +INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
 +```
 +
 +## Highlight
 +
 +This is the default `highlight` configuration. Note that some of these settings can be set per code block, see [Syntax Highlighting](/content-management/syntax-highlighting/).
 +
 +{{< code-toggle config=markup.highlight />}}
 +
 +For `style`, see these galleries:
 +
 +* [Short snippets](https://xyproto.github.io/splash/docs/all.html)
 +* [Long snippets](https://xyproto.github.io/splash/docs/longer/all.html)
 +
 +For CSS, see [Generate Syntax Highlighter CSS](/content-management/syntax-highlighting/#generate-syntax-highlighter-css).
 +
 +## Table of contents
 +
 +This is the default configuration for the table of contents, applicable to Goldmark and Asciidoctor:
 +
 +{{< code-toggle config=markup.tableOfContents />}}
 +
 +###### startLevel
 +
 +(`int`) Heading levels less than this value will be excluded from the table of contents. For example, to exclude `h1` elements from the table of contents, set this value to `2`. Default is `2`.
 +
 +###### endLevel
 +
 +(`int`) Heading levels greater than this value will be excluded from the table of contents. For example, to exclude `h4`, `h5`, and `h6` elements from the table of contents, set this value to `3`. Default is `3`.
 +
 +###### ordered
 +
 +(`bool`) If `true`, generates an ordered list instead of an unordered list. Default is `false`.
index df7eaa2a913e249b597a5995114e77b8cf0e5449,0000000000000000000000000000000000000000..67ef4b7cdc7a00ae8702cdbbf83d9b8d74bdf348
mode 100644,000000..100644
--- /dev/null
@@@ -1,213 -1,0 +1,213 @@@
- sourceMapIncludeSources {{< new-in 0.108.0 >}}
 +---
 +title: ToCSS
 +linkTitle: Transpile Sass to CSS
 +description: Transpile Sass to CSS.
 +categories: [asset management]
 +keywords: []
 +menu:
 +  docs:
 +    parent: hugo-pipes
 +    returnType: resource.Resource
 +    weight: 30
 +weight: 30
 +action:
 +  aliases: [toCSS]
 +  returnType: resource.Resource
 +  signatures: ['css.Sass [OPTIONS] RESOURCE']
 +toc: true
 +aliases: [/hugo-pipes/transform-to-css/]
 +---
 +
 +## Usage
 +
 +Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended and extended/deploy editions, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
 +
 +```go-html-template
 +{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
 +{{ with resources.Get "sass/main.scss" | toCSS $opts | minify | fingerprint }}
 +  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
 +{{ end }}
 +```
 +
 +Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.
 +
 +[scss]: https://sass-lang.com/documentation/syntax#scss
 +[indented]: https://sass-lang.com/documentation/syntax#the-indented-syntax
 +
 +## Options
 +
 +transpiler
 +: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended and extended/deploy editions include the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
 +
 +targetPath
 +: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
 +
 +vars {{< new-in 0.109.0 >}}
 +: (`map`) A map of key-value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/).
 +
 +```scss
 +// LibSass
 +@import "hugo:vars";
 +
 +// Dart Sass
 +@use "hugo:vars" as v;
 +```
 +
 +outputStyle
 +: (`string`) Output styles available to LibSass include `nested` (default), `expanded`, `compact`, and `compressed`. Output styles available to Dart Sass include `expanded` (default) and `compressed`.
 +
 +precision
 +: (`int`) Precision of floating point math. Not applicable to Dart Sass.
 +
 +enableSourceMap
 +: (`bool`) If `true`, generates a source map.
 +
++sourceMapIncludeSources
 +: (`bool`) If `true`, embeds sources in the generated source map. Not applicable to LibSass.
 +
 +includePaths
 +: (`slice`) A slice of paths, relative to the project root, that the transpiler will use when resolving `@use` and `@import` statements.
 +
 +```go-html-template
 +{{ $opts := dict
 +  "transpiler" "dartsass"
 +  "targetPath" "css/style.css"
 +  "vars" site.Params.styles
 +  "enableSourceMap" (not hugo.IsProduction)
 +  "includePaths" (slice "node_modules/bootstrap/scss")
 +}}
 +{{ with resources.Get "sass/main.scss" | toCSS $opts | minify | fingerprint }}
 +  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
 +{{ end }}
 +```
 +
 +## Dart Sass
 +
 +The extended version of Hugo includes [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].
 +
 +Use the latest features of the Sass language by installing Dart Sass in your development and production environments.
 +
 +### Installation overview
 +
 +Dart Sass is compatible with Hugo v0.114.0 and later.
 +
 +If you have been using Embedded Dart Sass[^1] with Hugo v0.113.0 and earlier, uninstall Embedded Dart Sass, then install Dart Sass. If you have installed both, Hugo will use Dart Sass.
 +
 +If you install Hugo as a [Snap package] there is no need to install Dart Sass. The Hugo Snap package includes Dart Sass.
 +
 +[^1]: In 2023, the Sass team deprecated Embedded Dart Sass in favor of Dart Sass.
 +
 +### Installing in a development environment
 +
 +When you install Dart Sass somewhere in your PATH, Hugo will find it.
 +
 +OS|Package manager|Site|Installation
 +:--|:--|:--|:--
 +Linux|Homebrew|[brew.sh]|`brew install sass/sass/sass`
 +Linux|Snap|[snapcraft.io]|`sudo snap install dart-sass`
 +macOS|Homebrew|[brew.sh]|`brew install sass/sass/sass`
 +Windows|Chocolatey|[chocolatey.org]|`choco install sass`
 +Windows|Scoop|[scoop.sh]|`scoop install sass`
 +
 +You may also install [prebuilt binaries] for Linux, macOS, and Windows.
 +
 +Run `hugo env` to list the active transpilers.
 +
 +### Installing in a production environment
 +
 +For [CI/CD] deployments (e.g., GitHub Pages, GitLab Pages, Netlify, etc.) you must edit the workflow to install Dart Sass before Hugo builds the site[^2]. Some providers allow you to use one of the package managers above, or you can download and extract one of the prebuilt binaries.
 +
 +[^2]: You do not have to do this if (a) you have not modified the assets cache location, and (b) you have not set `useResourceCacheWhen` to `never` in your [site configuration], and (c) you add and commit your resources directory to your repository.
 +
 +#### GitHub Pages
 +
 +To install Dart Sass for your builds on GitHub Pages, add this step to the GitHub Pages workflow file:
 +
 +```yaml
 +- name: Install Dart Sass
 +  run: sudo snap install dart-sass
 +```
 +
 +If you are using GitHub Pages for the first time with your repository, GitHub provides a [starter workflow] for Hugo that includes Dart Sass. This is the simplest way to get started.
 +
 +#### GitLab Pages
 +
 +To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file should look something like this:
 +
 +```yaml
 +variables:
 +  HUGO_VERSION: 0.137.1
 +  DART_SASS_VERSION: 1.80.6
 +  GIT_DEPTH: 0
 +  GIT_STRATEGY: clone
 +  GIT_SUBMODULE_STRATEGY: recursive
 +  TZ: America/Los_Angeles
 +image:
 +  name: golang:1.20-buster
 +pages:
 +  script:
 +    # Install Dart Sass
 +    - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
 +    - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
 +    - cp -r dart-sass/* /usr/local/bin
 +    - rm -rf dart-sass*
 +    # Install Hugo
 +    - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
 +    - apt install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
 +    - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
 +    # Build
 +    - hugo --gc --minify
 +  artifacts:
 +    paths:
 +      - public
 +  rules:
 +    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
 +```
 +
 +#### Netlify
 +
 +To install Dart Sass for your builds on Netlify, the `netlify.toml` file should look something like this:
 +
 +```toml
 +[build.environment]
 +HUGO_VERSION = "0.137.1"
 +DART_SASS_VERSION = "1.80.6"
 +TZ = "America/Los_Angeles"
 +
 +[build]
 +publish = "public"
 +command = """\
 +  curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
 +  tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
 +  rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
 +  export PATH=/opt/build/repo/dart-sass:$PATH && \
 +  hugo --gc --minify \
 +  """
 +```
 +
 +### Example
 +
 +To transpile with Dart Sass, set `transpiler` to `dartsass` in the options map passed to `css.Sass`. For example:
 +
 +```go-html-template
 +{{ $opts := dict "transpiler" "dartsass" "targetPath" "css/style.css" }}
 +{{ with resources.Get "sass/main.scss" | toCSS $opts | minify | fingerprint }}
 +  <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
 +{{ end }}
 +```
 +
 +### Miscellaneous
 +
 +If you build Hugo from source and run `mage test -v`, the test will fail if you install Dart Sass as a Snap package. This is due to the Snap package's strict confinement model.
 +
 +[brew.sh]: https://brew.sh/
 +[chocolatey.org]: https://community.chocolatey.org/packages/sass
 +[ci/cd]: https://en.wikipedia.org/wiki/CI/CD
 +[dart sass]: https://sass-lang.com/dart-sass
 +[libsass]: https://sass-lang.com/libsass
 +[prebuilt binaries]: https://github.com/sass/dart-sass/releases/latest
 +[scoop.sh]: https://scoop.sh/#/apps?q=sass
 +[site configuration]: /getting-started/configuration/#configure-build
 +[snap package]: /installation/linux/#snap
 +[snapcraft.io]: https://snapcraft.io/dart-sass
 +[starter workflow]: https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml
index 795fcad769552063c23362ae9ce4239dc7443bb2,0000000000000000000000000000000000000000..78cddc27a94b6fc581138bb299d82464481e4c7a
mode 100644,000000..100644
--- /dev/null
@@@ -1,21 -1,0 +1,20 @@@
-   related:
 +---
 +title: Truncate
 +description: Returns the result of rounding DURATION1 toward zero to a multiple of DURATION2.
 +categories: []
 +keywords: []
 +action:
 +  related:
 +    - functions/time/Duration
 +    - functions/time/ParseDuration
 +  returnType: time.Duration
 +  signatures: [DURATION1.Truncate DURATION2]
 +---
 +
 +```go-html-template
 +{{ $d = time.ParseDuration "3.5h2.5m1.5s" }}
 +
 +{{ $d.Truncate (time.ParseDuration "2h") }} → 2h0m0s
 +{{ $d.Truncate (time.ParseDuration "3m") }} → 3h30m0s
 +{{ $d.Truncate (time.ParseDuration "4s") }} → 3h32m28s
 +```
index a428720d739e8badffc89846ccf11bd62b6edf82,0000000000000000000000000000000000000000..2814bcc2aba2d35102c75a481e8e6530961b0b76
mode 100644,000000..100644
--- /dev/null
@@@ -1,153 -1,0 +1,154 @@@
- ## Use the RenderString method
 +---
 +title: Inner
 +description: Returns the content between opening and closing shortcode tags, applicable when the shortcode call includes a closing tag.
 +categories: []
 +keywords: []
 +action:
 +  related:
 +    - functions/strings/Trim
 +    - methods/page/RenderString
 +    - functions/transform/Markdownify
 +    - methods/shortcode/InnerDeindent
 +  returnType: template.HTML
 +  signatures: [SHORTCODE.Inner]
++toc: true
 +---
 +
 +This content:
 +
 +{{< code file=content/services.md lang=md >}}
 +{{</* card title="Product Design" */>}}
 +We design the **best** widgets in the world.
 +{{</* /card */>}}
 +{{< /code >}}
 +
 +With this shortcode:
 +
 +{{< code file=layouts/shortcodes/card.html  >}}
 +<div class="card">
 +  {{ with .Get "title" }}
 +    <div class="card-title">{{ . }}</div>
 +  {{ end }}
 +  <div class="card-content">
 +    {{ .Inner | strings.TrimSpace }}
 +  </div>
 +</div>
 +{{< /code >}}
 +
 +Is rendered to:
 +
 +```html
 +<div class="card">
 +  <div class="card-title">Product Design</div>
 +  <div class="card-content">
 +    We design the **best** widgets in the world.
 +  </div>
 +</div>
 +```
 +
 +{{% note %}}
 +Content between opening and closing shortcode tags may include leading and/or trailing newlines, depending on placement within the Markdown. Use the [`strings.TrimSpace`] function as shown above to remove both carriage returns and newlines.
 +
 +[`strings.TrimSpace`]: /functions/strings/trimspace/
 +{{% /note %}}
 +
 +{{% note %}}
 +In the example above, the value returned by `Inner` is Markdown, but it was rendered as plain text. Use either of the following approaches to render Markdown to HTML.
 +{{% /note %}}
 +
 +
- ## Use alternate notation
++## Use RenderString
 +
 +Let's modify the example above to pass the value returned by `Inner` through the [`RenderString`] method on the `Page` object:
 +
 +[`RenderString`]: /methods/page/renderstring/
 +
 +{{< code file=layouts/shortcodes/card.html  >}}
 +<div class="card">
 +  {{ with .Get "title" }}
 +    <div class="card-title">{{ . }}</div>
 +  {{ end }}
 +  <div class="card-content">
 +    {{ .Inner | strings.TrimSpace | .Page.RenderString }}
 +  </div>
 +</div>
 +{{< /code >}}
 +
 +Hugo renders this to:
 +
 +```html
 +<div class="card">
 +  <div class="card-title">Product design</div>
 +  <div class="card-content">
 +    We produce the <strong>best</strong> widgets in the world.
 +  </div>
 +</div>
 +```
 +
 +You can use the [`markdownify`] function instead of the `RenderString` method, but the latter is more flexible. See&nbsp;[details].
 +
 +[details]: /methods/page/renderstring/
 +[`markdownify`]: /functions/transform/markdownify/
 +
++## Alternative notation
 +
 +Instead of calling the shortcode with the `{{</* */>}}` notation, use the `{{%/* */%}}` notation:
 +
 +{{< code file=content/services.md lang=md >}}
 +{{%/* card title="Product Design" */%}}
 +We design the **best** widgets in the world.
 +{{%/* /card */%}}
 +{{< /code >}}
 +
 +When you use the `{{%/* */%}}` notation, Hugo renders the entire shortcode as Markdown, requiring the following changes.
 +
 +First, configure the renderer to allow raw HTML within Markdown:
 +
 +{{< code-toggle file=hugo >}}
 +[markup.goldmark.renderer]
 +unsafe = true
 +{{< /code-toggle >}}
 +
 +This configuration is not unsafe if _you_ control the content. Read more about Hugo's [security model].
 +
 +Second, because we are rendering the entire shortcode as Markdown, we must adhere to the rules governing [indentation] and inclusion of [raw HTML blocks] as provided in the [CommonMark] specification.
 +
 +{{< code file=layouts/shortcodes/card.html  >}}
 +<div class="card">
 +  {{ with .Get "title" }}
 +  <div class="card-title">{{ . }}</div>
 +  {{ end }}
 +  <div class="card-content">
 +
 +  {{ .Inner | strings.TrimSpace }}
 +  </div>
 +</div>
 +{{< /code >}}
 +
 +The difference between this and the previous example is subtle but required. Note the change in indentation, the addition of a blank line, and removal of the `RenderString` method.
 +
 +```diff
 +--- layouts/shortcodes/a.html
 ++++ layouts/shortcodes/b.html
 +@@ -1,8 +1,9 @@
 + <div class="card">
 +   {{ with .Get "title" }}
 +-    <div class="card-title">{{ . }}</div>
 ++  <div class="card-title">{{ . }}</div>
 +   {{ end }}
 +   <div class="card-content">
 +-    {{ .Inner | strings.TrimSpace | .Page.RenderString }}
 ++
 ++  {{ .Inner | strings.TrimSpace }}
 +   </div>
 + </div>
 +```
 +
 +{{% note %}}
 +When using the `{{%/* */%}}` notation, do not pass the value returned by `Inner` through the `RenderString` method or  the `markdownify` function.
 +{{% /note %}}
 +
 +[commonmark]: https://commonmark.org/
 +[indentation]: https://spec.commonmark.org/0.30/#indented-code-blocks
 +[raw html blocks]: https://spec.commonmark.org/0.30/#html-blocks
 +[security model]: /about/security/