You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

{{ $mentions := (where (where (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) "content" "!=" "") "type" "!=" "like") }}
{{ $wmServer := .Site.Params.webmentionServer }}
{{ 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>
<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>
{{ end }}
{{ if gt $i 5 }}
<a href="#mentions"><button>Collapse mentions</button></a>
</div>
{{ end }}
</div>
</small>
<br/>
{{ end }}