feat: blockquote comment

This commit is contained in:
Ben Goldsworthy 2025-02-23 00:32:39 +01:00
parent 8f593203b5
commit a7c1084dc4
Signed by: Rumperuu
SSH key fingerprint: SHA256:v3uompaUiPqV2w1/AIRWBSQOxr2dntH9Xs/y8fDnUPU

View file

@ -4,6 +4,7 @@
@params style Force a blockquote style. Optional.
@params cite URI for work. Optional.
@params source The speaker(s) of the quotation.
@params comment A comment to add after the citation. Optional.
For works cited (optional):
@params ibid Whether to use ibidem as the source. Optional.
@ -29,6 +30,7 @@
{{- $href := default "" ( index .Params "href" ) -}}
{{- $ibid := default false ( index .Params "ibid" ) -}}
{{- $source := .Params.source -}}
{{- $comment := .Params.comment -}}
{{- $isSourceHidden := default ( not ( or ( isset .Params "source" ) ( isset .Params "ibid" ) ) ) ( index .Params "hideSource" ) -}}
@ -54,7 +56,7 @@
<!-- Rendering -->
<figure
class="figure--blockquote blockquote{{- with $style }} blockquote--{{- . -}}{{- end -}}"
class="figure--blockquote blockquote {{ with $style }}blockquote--{{- . -}}{{- end -}}"
itemscope
itemtype="Quotation"
role="group"
@ -65,7 +67,7 @@
>
{{- .Inner | .Page.RenderString -}}
</blockquote>
<figcaption class="blockquote__caption{{- if $isSourceHidden }}blockquote__caption--hidden{{- end -}}">
<figcaption class="blockquote__caption {{ if $isSourceHidden }}blockquote__caption--hidden{{- end -}}">
{{- if $ibid -}}
<abbr
lang="la"
@ -92,6 +94,9 @@
{{- end -}}</span
>
{{- end -}}
{{- with $comment -}}
{{- printf " (%s)" . -}}
{{- end -}}
{{- end -}}
</figcaption>
</figure>