{{- /* To customize your own admonitions, you can do the following: 1. Change colors Define your colors in `assets/css/custom.css` using the variables from: https://github.com/nunocoracao/blowfish/blob/main/assets/css/components/admonition.css Example: ``` :root { --adm-note-bg: red; } html.dark { --adm-note-bg: green; } ``` This will update the background color for light and dark mode. 2. Change icons and type settings You can override the default type and icon mappings by creating your own `impls/hooks/admonition-maps.html` in your `layouts` folder. This allows you to assign different icons or styles for each admonition type. */ -}} {{- if eq .Type "alert" -}} {{- $maps := partialCached "impls/hooks/admonition-maps.html" . -}} {{- $typeMap := $maps.typeMap -}} {{- $iconMap := $maps.iconMap -}} {{- $rawType := .AlertType | lower -}} {{- $normalizedType := index $typeMap $rawType | default $rawType -}} {{- $iconName := .Attributes.icon | default (index $iconMap $normalizedType) | default "circle-info" -}} {{- $rawCustomTitle := .AlertTitle | default "" -}} {{- $trimmedCustomTitle := strings.TrimSpace $rawCustomTitle -}} {{- $hasCustomTitle := ne $trimmedCustomTitle "" -}} {{- $defaultTitle := i18n (printf "admonition.%s" $normalizedType) | default $normalizedType -}} {{- $admonitionTitle := cond $hasCustomTitle $rawCustomTitle $defaultTitle -}} {{- $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" -}} {{- $contentClass := "admonition-content mt-3 text-base leading-relaxed text-inherit" -}} {{- $titleClass := "grow" -}} {{- if not $hasCustomTitle -}} {{- $titleClass = printf "%s %s" $titleClass "capitalize" -}} {{- end -}} {{- $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 -}}