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