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

60 lines
1.6 KiB
HTML
Raw Normal View History

{{ $mentions := (where (where (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) "content" "!=" "") "type" "!=" "like") }}
{{ $wmServer := .Site.Params.webmentionServer }}
2021-03-09 11:55:58 +01:00
{{ if $mentions }}
<h3 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
</h3>
2021-03-09 11:55:58 +01:00
<small>
<div class="tootlist" style="margin-bottom: -3rem">
{{ $i := 0 }}
{{ $done := 0 }}
{{ range $mentions }}
{{ $i = add $i 1 }}
{{ if and (gt $i 5) (eq $done 0) }}
{{ $done = 1 }}
<a href="#morementions"><button>Show {{ add (sub (len $mentions) $i) 1 }} more...</button></a>
<div id="morementions">
{{ end }}
<article class="u-comment h-cite toot">
{{ $name := .author.name | safeHTML }}
<p class="p-content p-name">
{{ if .content }}
{{ .content | safeHTML }}
{{ else }}
{{ $name }} liked this post.
{{ end }}
</p>
<div class="meta">
<svg class='icon icon-small'>
<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 }}">
{{ $name }}
</a>
</div>
</article>
2021-03-09 11:55:58 +01:00
{{ end }}
{{ if gt $i 5 }}
<a href="#mentions"><button>Collapse mentions</button></a>
</div>
{{ end }}
</div>
</small>
<br/>
2021-03-09 11:55:58 +01:00
{{ end }}