trwnh.com/unified.test.hugo/layouts/partials/mf2/h-cite.html

47 lines
1.5 KiB
HTML
Raw Normal View History

2024-10-12 18:45:14 +00:00
{{ $author := .author }}
{{ $content := .content }}
{{ $cite := .cite }}
{{ $name := .name }}
{{ $caption := .caption }}
<article class="quote-block h-cite{{ if $author}} has-h-card{{end}}">
{{ with $author }}
<header style="display: contents">
<p style="display: contents">
<span class="p-author">
{{ partial "mf2/h-card.html" . }}
</span>
<span style="display: none"> wrote:</span>
</p>
</header>
{{ else }}
<header style="display: contents">
<svg class="quote-block__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290 290" width="1em" height="1em" fill="currentColor"><title>quote</title><path d="M22.12 145v97.65h97.65V145H70.95c0-26.92 21.9-48.82 48.82-48.82V47.35c-53.93 0-97.65 43.72-97.65 97.65zm245.76-48.82V47.35c-53.93 0-97.65 43.72-97.65 97.65v97.65h97.65V145h-48.82c-.01-26.92 21.89-48.82 48.82-48.82z"></path></svg>
</header>
{{ end }}
{{ with $content }}
<section style="display: contents">
<blockquote class="quote-block__content e-content"{{ with $cite }} cite="{{.}}"{{end}}>
{{.}}
</blockquote>
</section>
{{ end }}
{{ if (or $cite $caption) }}
<footer style="display: contents">
<p style="display: contents">
{{ with $cite }}
<a href="{{.}}" class="u-url">
{{ with $name }}
<span>{{ . | markdownify }}</span>
{{ else }}
<span>(View quote in its original context)</span>
{{ end }}
</a>
{{ else }}
{{ with $caption }}
<span>{{ . | markdownify }}</span>
{{ end }}
{{ end }}
</p>
</footer>
{{ end }}
</article>