{{- if eq .Type "alert" -}} {{- $typeMap := dict "attention" "warning" "check" "success" "cite" "quote" "done" "success" "error" "danger" "fail" "failure" "faq" "question" "hint" "tip" "help" "question" "missing" "failure" "summary" "abstract" "tldr" "abstract" -}} {{- $iconMap := dict "abstract" "file-lines" "bug" "bug" "caution" "fire" "danger" "fire" "example" "list-ol" "failure" "xmark" "important" "star" "info" "circle-info" "note" "circle-info" "success" "check" "todo" "list-check" "tip" "lightbulb" "question" "circle-question" "quote" "quote-left" "warning" "triangle-exclamation" -}} {{- $rawType := .AlertType | lower -}} {{- $normalizedType := index $typeMap $rawType | default $rawType -}} {{- $iconName := index $iconMap $normalizedType | default "circle-info" -}} {{- $admonitionTitle := .AlertTitle | default (i18n (printf "admonition.%s" $normalizedType) | default $normalizedType) -}} {{- $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" -}} {{- $contentClass := "admonition-content mt-3 text-base leading-relaxed text-inherit" -}} {{- $isCollapsible := in (slice "+" "-") .AlertSign -}} {{- if $isCollapsible -}}
{{- partial "icon.html" $iconName -}}
{{ $admonitionTitle }}
{{- partial "icon.html" "chevron-down" -}}
{{- if .Text -}}
{{- .Text | safeHTML -}}
{{- end -}}
{{- else -}}
{{- partial "icon.html" $iconName -}}
{{ $admonitionTitle }}
{{- if .Text -}}
{{- .Text | safeHTML -}}
{{- end -}}
{{- end -}} {{- else -}}
{{- .Text | safeHTML -}}
{{- end -}}