brainbaking/themes/brainbaking-minimal/layouts/partials/single-webmentions.html

61 lines
1.9 KiB
HTML

{{ $mentions := (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) }}
{{ $wmServer := .Site.Params.webmentionServer }}
{{ if $mentions }}
<h4 class="page-header" id="mentions">
<a href="#mentions">
<svg class='icon icon-text' width='24' height='24'>
<title>Discussion</title>
<use xlink:href='#discuss'></use>
</svg>
</a>
Mentions and Replies
</h4>
<div class="tootlist" style="margin-bottom: -3rem">
{{ range $mentions }}
{{ $name := .author.name | safeHTML }}
<article class="u-comment h-cite toot">
<p class="p-content p-name">
{{ if .content }}
{{ .content | safeHTML }}
{{ else }}
{{ $name }} liked this post.
{{ end }}
</p>
<div class="meta">
<svg class='icon icon-text' width='24' height='24'>
<use xlink:href='#cal1'></use>
</svg>
<time class="dt-published" datetime="{{ .published }}">
{{- $publishedAsDate := .published | time -}}
{{ partial "reldate" $publishedAsDate }}
</time>
&nbsp;|&nbsp;by&nbsp;
<a rel="author" class="u-author h-card u-url permalink" href="{{ .source }}">
{{ if isset .author "picture" }}
<div class="avatar">
{{- $image := resources.Get (printf "%s%s.jpg" "wmpics/" .author.picture ) -}}
{{ if eq $image nil }}
<img class="u-photo" loading="lazy" src="/img/avatar-anonymous.jpg" alt="{{ $name }} anonymous photo" />
{{ else }}
{{- $imgsmall := $image.Resize "100x jpg q85" }}
<img class="u-photo" loading="lazy" src="{{ $imgsmall.RelPermalink }}" alt="{{ $name }}" />
{{ end }}
</div>
{{ else }}
<div class="avatar">
<img class="u-photo" loading="lazy" src="/img/avatar-anonymous.jpg" alt="{{ $name }} anonymous photo" />
</div>
{{ end }}
{{ $name }}
</a>
</div>
</article>
{{ end }}
</div>
<br/>
{{ end }}