56 lines
No EOL
1.7 KiB
HTML
56 lines
No EOL
1.7 KiB
HTML
{{- $author := .author }}
|
|
{{- $card := .card }}
|
|
{{- $content := .content }}
|
|
{{- $cite := .cite }}
|
|
{{- $title := .title }}
|
|
{{- $ref := .ref }}
|
|
{{- $caption := .caption }}
|
|
<article class="quote-block{{if $cite}} h-cite{{end}}{{ if $author}} h-x-quote{{end}}">
|
|
{{- with or $card $author }}
|
|
<header class="quote-block__header">
|
|
<p class="quote-block__attribution">
|
|
{{- with $card }}
|
|
<span class="quote-block__card p-author">{{ partial "mf2/h-card.html" . }}</span>
|
|
{{- else with $author }}
|
|
<span class="quote-block__author p-author h-card">
|
|
{{ . | markdownify }}
|
|
</span>
|
|
{{- end -}}
|
|
<span class="quote-block__postpend"> wrote:</span>
|
|
</p>
|
|
</header>
|
|
{{- else }}
|
|
<header class="quote-block__header">
|
|
<p class="quote-block__prepend">Quote:</p>
|
|
</header>
|
|
{{- end }}
|
|
{{- with $content }}
|
|
<section class="quote-block__content">
|
|
<blockquote class="e-content"{{ with $cite }} cite="{{.}}"{{end}}>
|
|
{{. -}}
|
|
</blockquote>
|
|
</section>
|
|
{{- end }}
|
|
{{- if (or $caption $cite) }}
|
|
<footer class="quote-block__footer">
|
|
<p style="display: contents">
|
|
{{- with $caption }} {{/* caption is manually set and overrides cite+title+ref/etc */}}
|
|
<span class="quote-block__caption">{{ . | markdownify }}</span>
|
|
{{- else }} {{/* no caption, so make one from the cite+title and ref/etc */}}
|
|
{{- if $title }}
|
|
<span class="quote-block__caption">
|
|
<cite><a href="{{$cite}}" class="u-url">{{$title}}</a></cite>
|
|
{{- with $ref}} {{/* TODO: make this more modular? break ref into page numbers, edition, etc */}}
|
|
{{.}}
|
|
{{- end }}
|
|
</span>
|
|
{{- else }} {{/* no title, so add a basic link */}}
|
|
<span class="quote-block__caption">
|
|
<a href="{{$cite}}" class="u-url">(View source)</a> {{/* also stop here bc a ref with no title makes no sense? */}}
|
|
</span>
|
|
{{- end }}
|
|
{{- end }}
|
|
</p>
|
|
</footer>
|
|
{{- end }}
|
|
</article> |