{{- /* Renders a block quotation. @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. @see partials/cite.html for full list of args. */ -}} {{- $valid_styles := slice "" "epigram" "script" -}} {{- $style := default "" ( index .Params "style" ) -}} {{- $cite := default "" ( index .Params "cite" ) -}} {{- $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" ) -}} {{- $hasCitedWork := ( isset .Params "title" ) }} {{- if ( not ( in $valid_styles $style ) ) -}} {{- errorf "Invalid blockquote style (%q) provided" $style -}} {{- end -}} {{- if ( not ( or ( isset .Params "source" ) ( isset .Params "ibid" ) ) ) -}} {{- erroridf "blockquote-no-params" "No source provided for blockquote" -}} {{- end -}} {{- if ( not ( isset $.Params "cite" ) ) -}} {{- erroridf "missing-cite" "No cite found for blockquote (%q)" .Page.File.Path -}} {{- end -}}
{{- .Inner | .Page.RenderString -}}
{{- if $ibid -}} Ibid. {{- else if $source -}} {{- $source | safeHTML -}} {{- if $hasCitedWork -}} , {{- partial "cite.html" ( dict "sc" $ "pc" . "Params" .Params ) -}} {{- end -}} {{- with $comment -}} {{- printf " (%s)" . -}} {{- end -}} {{- end -}}