trwnh.com/unified.test.hugo/layouts/_default/_markup/render-blockquote.html

33 lines
No EOL
1 KiB
HTML

{{- if .AlertType }}
{{- /* this is an alert/admonition, not a quote */}}
{{- $type := .AlertType }}
{{- $title := or .AlertTitle (strings.FirstUpper .AlertType) }}
{{- $text := .Text }}
{{- $opts := dict "ctx" . "type" $type "title" $title "text" $text }}
{{- partial "components/admonition.html" $opts }}
{{- else }}
{{- /* this is a quote */}}
{{- $datapath := (split (.Attributes.card) "/") }}
{{- $card := .Page.Site.Data.people }}
{{- range $datapath }}
{{- $card = index $card . }}
{{- end }}
{{- $author := .Attributes.author }}
{{- $content := .Text }}
{{- $cite := .Attributes.cite }}
{{- $title := .Attributes.title }}
{{- $ref := .Attributes.ref }}
{{- $caption := .Attributes.caption }}
{{- $opts := dict
"ctx" .
"card" $card
"author" $author
"content" $content
"cite" $cite
"title" $title
"ref" $ref
"caption" $caption }}
{{- printf "<!-- begin quote %s -->" (string (add .Ordinal 1)) | safeHTML }}
{{- partial "components/quote-block.html" $opts }}
{{ printf "<!-- end quote %s -->" (string (add .Ordinal 1)) | safeHTML }}
{{ end }}