diff --git a/modules/blox-tailwind/hugo.yaml b/modules/blox-tailwind/hugo.yaml index 821d830f..f093935b 100644 --- a/modules/blox-tailwind/hugo.yaml +++ b/modules/blox-tailwind/hugo.yaml @@ -20,7 +20,7 @@ markup: parser: # Support Latex math(?) attribute: - block: true + block: true # For callouts as quote blocks title: true extensions: # Support Latex math diff --git a/modules/blox-tailwind/i18n/de.yaml b/modules/blox-tailwind/i18n/de.yaml index 8161544b..6526b051 100644 --- a/modules/blox-tailwind/i18n/de.yaml +++ b/modules/blox-tailwind/i18n/de.yaml @@ -26,6 +26,22 @@ - id: related translation: Ähnliches +# Callouts +- id: callout_note + translation: Hinweis + +- id: callout_tip + translation: Tipp + +- id: callout_important + translation: Wichtig + +- id: callout_warning + translation: Warnung + +- id: callout_caution + translation: Vorsicht + - id: backlinks translation: Backlinks diff --git a/modules/blox-tailwind/i18n/en.yaml b/modules/blox-tailwind/i18n/en.yaml index fb6f71fa..04379c6b 100644 --- a/modules/blox-tailwind/i18n/en.yaml +++ b/modules/blox-tailwind/i18n/en.yaml @@ -26,6 +26,22 @@ - id: related translation: Related +# Callouts +- id: callout_note + translation: Note + +- id: callout_tip + translation: Tip + +- id: callout_important + translation: Important + +- id: callout_warning + translation: Warning + +- id: callout_caution + translation: Caution + - id: backlinks translation: Backlinks diff --git a/modules/blox-tailwind/i18n/es.yaml b/modules/blox-tailwind/i18n/es.yaml index 2965e828..32d7d1f6 100644 --- a/modules/blox-tailwind/i18n/es.yaml +++ b/modules/blox-tailwind/i18n/es.yaml @@ -26,6 +26,22 @@ - id: related translation: Relacionado +# Callouts +- id: callout_note + translation: Nota + +- id: callout_tip + translation: Consejo + +- id: callout_important + translation: Importante + +- id: callout_warning + translation: Advertencia + +- id: callout_caution + translation: Precaución + - id: minute_read translation: min de lectura diff --git a/modules/blox-tailwind/i18n/fr.yaml b/modules/blox-tailwind/i18n/fr.yaml index 8bd29587..2845cf93 100644 --- a/modules/blox-tailwind/i18n/fr.yaml +++ b/modules/blox-tailwind/i18n/fr.yaml @@ -26,6 +26,22 @@ - id: related translation: Sur le même sujet +# Callouts +- id: callout_note + translation: Note + +- id: callout_tip + translation: Conseil + +- id: callout_important + translation: Important + +- id: callout_warning + translation: Attention + +- id: callout_caution + translation: Prudence + - id: minute_read translation: min. de lecture diff --git a/modules/blox-tailwind/i18n/zh.yaml b/modules/blox-tailwind/i18n/zh.yaml index 8d336b42..98a88f21 100644 --- a/modules/blox-tailwind/i18n/zh.yaml +++ b/modules/blox-tailwind/i18n/zh.yaml @@ -26,6 +26,22 @@ - id: related translation: 相关 +# Callouts +- id: callout_note + translation: 注意 + +- id: callout_tip + translation: 提示 + +- id: callout_important + translation: 重要 + +- id: callout_warning + translation: 警告 + +- id: callout_caution + translation: 小心 + - id: minute_read translation: 分钟阅读时长 diff --git a/modules/blox-tailwind/layouts/_markup/render-blockquote.html b/modules/blox-tailwind/layouts/_markup/render-blockquote.html new file mode 100644 index 00000000..dcbabef1 --- /dev/null +++ b/modules/blox-tailwind/layouts/_markup/render-blockquote.html @@ -0,0 +1,31 @@ +{{/* + Hugo Blox Builder Blockquote Render Hook + + Renders standard blockquotes and GitHub/Obsidian-style alerts (callouts). + + Supports alert types: note, tip, important, warning, caution + Syntax examples: + - > [!NOTE] + > This is a note callout. + + - > [!WARNING]+ Custom Title + > This is a warning with custom title. +*/}} + +{{ if eq .Type "alert" }} + {{/* Use custom title if provided, otherwise let render_callout handle default */}} + {{ $title := .AlertTitle }} + + {{/* Use shared callout renderer */}} + {{ partial "functions/render_callout" (dict + "type" .AlertType + "content" .Text + "title" $title + "source" "renderhook" + ) }} +{{ else }} + {{/* Render regular blockquotes */}} +
+ {{ .Text }} ++{{ end }} diff --git a/modules/blox-tailwind/layouts/_shortcodes/callout.html b/modules/blox-tailwind/layouts/_shortcodes/callout.html index 32f2e820..5d14ac65 100644 --- a/modules/blox-tailwind/layouts/_shortcodes/callout.html +++ b/modules/blox-tailwind/layouts/_shortcodes/callout.html @@ -1,4 +1,17 @@ {{/* + DEPRECATED: This shortcode is deprecated in favor of standard Markdown alert syntax. + + Instead of: + {{< callout note >}} + Your content here + {{< /callout >}} + + Use standard GitHub/Obsidian alert syntax: + > [!NOTE] + > Your content here + + This provides better portability across Markdown platforms. + Docs: https://docs.hugoblox.com/reference/markdown/#callouts Parameters @@ -8,25 +21,16 @@ Default Hugo Blox Builder available options include "note" and "warning". Otherwise, you can add your own icon to assets/media/icons/ and reference its name when calling the shortcode. */}} -{{ $icon := "information-circle" }} -{{ $class := "bg-primary-100 dark:bg-primary-900" }} -{{ $class_text := "text-primary-600 dark:text-primary-300" }} -{{ with (.Get 0) }} - {{ if eq . "note" }} - {{ $icon = "information-circle" }} - {{ else if eq . "warning" }} - {{ $icon = "exclamation-triangle" }} - {{ $class = "bg-yellow-100 dark:bg-yellow-900" }} - {{ $class_text = "text-red-400" }} - {{ else }} - {{ $icon = . }} - {{end}} -{{end}} -