Merge pull request #2704 from RxChi1d/fix/admonition-title-casing

fix(admonition): preserve custom title casing and integrate upstream improvements
This commit is contained in:
Nuno C.
2026-01-12 17:45:21 +00:00
committed by GitHub
2 changed files with 19 additions and 2 deletions

View File

@@ -85,3 +85,20 @@ shortcode:
recent: recent:
show_more: "Show More" show_more: "Show More"
admonition:
abstract: "Abstract"
bug: "Bug"
caution: "Caution"
danger: "Danger"
example: "Example"
failure: "Failure"
important: "Important"
info: "Info"
note: "Note"
question: "Question"
quote: "Quote"
success: "Success"
tip: "Tip"
todo: "Todo"
warning: "Warning"

View File

@@ -33,10 +33,10 @@
{{- $normalizedType := index $typeMap $rawType | default $rawType -}} {{- $normalizedType := index $typeMap $rawType | default $rawType -}}
{{- $iconName := .Attributes.icon | default (index $iconMap $normalizedType) | default "circle-info" -}} {{- $iconName := .Attributes.icon | default (index $iconMap $normalizedType) | default "circle-info" -}}
{{- $admonitionTitle := .AlertTitle | default (i18n (printf "admonition.%s" $normalizedType) | default $normalizedType) -}} {{- $admonitionTitle := .AlertTitle | default ((i18n (printf "admonition.%s" $normalizedType) | default $normalizedType) | title) -}}
{{- $containerClass := "admonition relative overflow-hidden rounded-lg border-l-4 my-3 px-4 py-3 shadow-sm" -}} {{- $containerClass := "admonition relative overflow-hidden rounded-lg border-l-4 my-3 px-4 py-3 shadow-sm" -}}
{{- $headerClass := "flex items-center gap-2 font-semibold text-inherit capitalize" -}} {{- $headerClass := "flex items-center gap-2 font-semibold text-inherit" -}}
{{- $contentClass := "admonition-content mt-3 text-base leading-relaxed text-inherit" -}} {{- $contentClass := "admonition-content mt-3 text-base leading-relaxed text-inherit" -}}
{{- $isCollapsible := in (slice "+" "-") .AlertSign -}} {{- $isCollapsible := in (slice "+" "-") .AlertSign -}}