mirror of
https://github.com/tiennm99/tsuki.git
synced 2026-09-01 14:21:49 +00:00
Add blockquote-to-callout rendering, reading time estimate, improved default archetype with demo callout content and Vietnamese translations.
26 lines
765 B
HTML
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 -}}
|