hugo/docs/content/en/render-hooks/blockquotes.md

208 lines
6 KiB
Markdown
Raw Normal View History

Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
---
title: Blockquote render hooks
linkTitle: Blockquotes
description: Create a blockquote render hook to override the rendering of Markdown blockquotes to HTML.
categories: [render hooks]
keywords: []
menu:
docs:
parent: render-hooks
weight: 30
weight: 30
toc: true
---
{{< new-in 0.132.0 >}}
## Context
Blockquote render hook templates receive the following [context]:
[context]: /getting-started/glossary/#context
###### AlertType
(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
###### AlertTitle
{{< new-in 0.134.0 >}}
(`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below.
###### AlertSign
{{< new-in 0.134.0 >}}
(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of&nbsp;`+`,&nbsp;`-`,&nbsp;or an empty string. See the [alerts](#alerts) section below.
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
###### Attributes
(`map`) The [Markdown attributes], available if you configure your site as follows:
[Markdown attributes]: /content-management/markdown-attributes/
{{< code-toggle file=hugo >}}
[markup.goldmark.parser.attribute]
block = true
{{< /code-toggle >}}
###### Ordinal
(`int`) The zero-based ordinal of the blockquote on the page.
###### Page
(`page`) A reference to the current page.
###### PageInner
(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
[`RenderShortcodes`]: /methods/page/rendershortcodes
###### Position
(`string`) The position of the blockquote within the page content.
###### Text
(`template.HTML`) The blockquote text, excluding the first line if [`Type`](#type) is `alert`. See the [alerts](#alerts) section below.
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
###### Type
(`bool`) The blockquote type. Returns `alert` if the blockquote has an alert designator, else `regular`. See the [alerts](#alerts) section below.
## Examples
In its default configuration, Hugo renders Markdown blockquotes according to the [CommonMark specification]. To create a render hook that does the same thing:
[CommonMark specification]: https://spec.commonmark.org/current/
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
<blockquote>
{{ .Text }}
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
</blockquote>
{{< /code >}}
To render a blockquote as an HTML `figure` element with an optional citation and caption:
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
<figure>
<blockquote {{ with .Attributes.cite }}cite="{{ . }}"{{ end }}>
{{ .Text }}
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
</blockquote>
{{ with .Attributes.caption }}
<figcaption class="blockquote-caption">
{{ . | safeHTML }}
</figcaption>
{{ end }}
</figure>
{{< /code >}}
Then in your markdown:
```text
> Some text
{cite="https://gohugo.io" caption="Some caption"}
```
## Alerts
Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphasize critical information.
### Basic syntax
With the basic Markdown syntax, the first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets. For example:
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
{{< code file=content/example.md lang=text >}}
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
{{< /code >}}
The basic syntax is compatible with [GitHub], [Obsidian], and [Typora].
[GitHub]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
[Obsidian]: https://help.obsidian.md/Editing+and+formatting/Callouts
[Typora]: https://support.typora.io/Markdown-Reference/#callouts--github-style-alerts
### Extended syntax
With the extended Markdown syntax, you may optionally include an alert sign and/or an alert title. The alert sign is one of&nbsp;`+`&nbsp;or&nbsp;`-`, typically used to indicate whether an alert is graphically foldable. For example:
{{< code file=content/example.md lang=text >}}
> [!WARNING]+ Radiation hazard
> Do not approach or handle without protective gear.
{{< /code >}}
The extended syntax is compatible with [Obsidian].
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
{{% 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.
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
{{% /note %}}
### Example
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
This blockquote render hook renders a multilingual alert if an alert designator is present, otherwise it renders a blockquote according to the CommonMark specification.
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
{{ $emojis := dict
"caution" ":exclamation:"
"important" ":information_source:"
"note" ":information_source:"
"tip" ":bulb:"
"warning" ":information_source:"
}}
{{ if eq .Type "alert" }}
<blockquote class="alert alert-{{ .AlertType }}">
<p class="alert-heading">
{{ transform.Emojify (index $emojis .AlertType) }}
{{ with .AlertTitle }}
{{ . }}
{{ else }}
{{ or (i18n .AlertType) (title .AlertType) }}
{{ end }}
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
</p>
{{ .Text }}
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
</blockquote>
{{ else }}
<blockquote>
{{ .Text }}
Squashed 'docs/' changes from fcc3ed651..a49697e53 a49697e53 Add private use subtag requirements to multilingual page a5c6bb4da Add INFINI Pizza search engine 45b732efa Fix template lookup order for AMP pages 30c672d0b netlify: Hugo 0.133.1 7c766e724 Update page resources documentation ca802fbec Document how to enable AsciiDoc syntax highlighting c3350f4cf Update definition of falsy to include zero time.Time values b0e5ab051 Fir typo 60f6cb63b Update migrations.md ec52c7ba1 Improve formatting of example code e5681ad01 Improve formatting of example code bdf3ffc73 Clarify the various next/prev methods b5505d22a Clarify template lookup order for shortcodes cf8dd7034 Improve embedded.md e5dee2651 Update transform.ToMath 4d419a128 Update pagination configuration to use new struct 05d4fd597 Update PrevInSection.md fd33370ed Add new-in 0.133.0 f9062042f Add the new page config section 205645e97 Remove out-dated new-in 3ed3673f7 Fix typo 41df91659 Document the 'else with' construct introduced with Go 1.23 9c4697ab3 netlify: Hugo 0.133.0 62506b052 Merge branch 'temp133' 877e1bfcd Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder eb159fe62 Update menu.md efa7795a0 Update theme dbe8911ad netlify: Hugo 0.132.2 2f793d328 Document passthrough render hooks a7ce9a5e8 netlify: Hugo 0.132.1 2c137cb48 Update blockquotes.md e0fa2f0d1 Add new-in badge to blockquote render hook page bf42bbe6b Update references to render hooks 85a3d9958 Update theme 2dae72128 Document blockquote render hooks 8f5afb55d Update plainify return type 160f22d0e netlify: Hugo 0.132.0 82b5586fb Document transform.ToMath 1efcbcddb tpl/transform: Make Plainify and ToMath return template.HTML 31727be2e docs: Regen docshelper 88a421426 Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae' git-subtree-dir: docs git-subtree-split: a49697e536ee0d477ab4e552cfa8dc74debeff27
2024-09-01 08:51:15 -04:00
</blockquote>
{{ end }}
{{< /code >}}
To override the label, create these entries in your i18n files:
{{< code-toggle file=i18n/en.toml >}}
caution = 'Caution'
important = 'Important'
note = 'Note'
tip = 'Tip'
warning = 'Warning'
{{< /code-toggle >}}
Although you can use one template with conditional logic as shown above, you can also create separate templates for each [`Type`](#type) of blockquote:
```text
layouts/
└── _default/
└── _markup/
├── render-blockquote-alert.html
└── render-blockquote-regular.html
```
{{% include "/render-hooks/_common/pageinner.md" %}}