Files
tsuki/layouts/_markup/render-blockquote.html
T
tiennm99 a7ca99f595 feat: native Markdown callouts, reading time, archetype scaffold
Add blockquote-to-callout rendering, reading time estimate, improved default
archetype with demo callout content and Vietnamese translations.
2026-05-09 09:32:29 +07:00

26 lines
765 B
HTML

{{- /*
Blockquote render hook with native Markdown callout support (Hugo 0.140+).
Markdown:
> [!note] Optional title
> Body content here.
Renders to a styled callout. Plain blockquotes pass through unchanged.
Supported alert types: note, tip, important, warning, caution.
*/ -}}
{{- if eq .Type "alert" -}}
{{- $type := .AlertType | lower -}}
{{- $title := .AlertTitle -}}
{{- if not $title -}}
{{- $title = i18n (printf "callout%s" ($type | title)) | default ($type | title) -}}
{{- end -}}
<blockquote class="callout callout-{{ $type }}">
<p class="callout-title">{{ $title }}</p>
{{ .Text }}
</blockquote>
{{- else -}}
<blockquote
{{- range $k, $v := .Attributes }} {{ $k }}="{{ $v }}"{{ end -}}
>
{{ .Text }}
</blockquote>
{{- end -}}