aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-09-01 12:00:13 +0200
committerBjørn Erik Pedersen <[email protected]>2024-09-01 18:12:26 +0200
commite651d29801325095cb6a684fb7ce31934ce2906c (patch)
tree4d6606f8b5c0b25fbd93030cd75f3665661dbed4 /docs
parent0c453420e6fceccf36d06cea0a9e53ac6b8401ba (diff)
downloadhugo-e651d29801325095cb6a684fb7ce31934ce2906c.tar.gz
hugo-e651d29801325095cb6a684fb7ce31934ce2906c.zip
Add support for Obsidian type blockquote alerts
* Make the alert type parsing more flexible to support more types * Add `AlertTitle` and `AlertSign` (for folding) Note that GitHub will not render callouts with alert title/sign. See https://help.obsidian.md/Editing+and+formatting/Callouts Closes #12805 Closes #12801
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/content/en/render-hooks/blockquotes.md20
1 files changed, 17 insertions, 3 deletions
diff --git a/docs/content/en/render-hooks/blockquotes.md b/docs/content/en/render-hooks/blockquotes.md
index e0eda5c51..607514f04 100755
--- a/docs/content/en/render-hooks/blockquotes.md
+++ b/docs/content/en/render-hooks/blockquotes.md
@@ -24,6 +24,20 @@ Blockquote render hook templates receive the following [context]:
(`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 >}}
+
+(`hstring.HTML`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is the alert title converted to HTML.
+
+###### AlertSign
+
+{{< new-in 0.134.0 >}}
+
+(`string`) Applicable when [`Type`](#type) is `alert` when using [Obsidian callouts] syntax, this is one of "+", "-" or "" (empty string) to indicate the presence of a foldable sign.
+
+[Obsidian callouts]: https://help.obsidian.md/Editing+and+formatting/Callouts
+
###### Attributes
(`map`) The [Markdown attributes], available if you configure your site as follows:
@@ -117,13 +131,13 @@ Also known as _callouts_ or _admonitions_, alerts are blockquotes used to emphas
{{% note %}}
-This syntax is compatible with the GitHub Alert Markdown extension.
+This syntax is compatible with both the GitHub Alert Markdown extension and Obsidian's callout syntax.
+But note that GitHub will not recognize callouts with one of Obsidian's extensions (e.g. callout title or the foldable sign).
{{% /note %}}
-
The first line of each alert is an alert designator consisting of an exclamation point followed by the alert type, wrapped within brackets.
-The blockquote render hook below renders a multilingual alert if an alert desginator is present, otherwise it renders a blockquote according to the CommonMark specification.
+The blockquote render hook below renders a multilingual alert if an alert designator is present, otherwise it renders a blockquote according to the CommonMark specification.
{{< code file=layouts/_default/_markup/render-blockquote.html copy=true >}}
{{ $emojis := dict