summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts/action-menu.html
blob: 9358ce0db49817c2ab0e45bf751790c5e14dc546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{{ $webmentions := index .Site.Data.webmentions .RelPermalink }}
{{ $likes := slice }}
{{ $replies := slice }}
{{ $mentions := slice }}
{{ with $webmentions }}
{{ range . }}
  {{ if eq .type "like-of" }}
    {{ $likes = $likes | append . }}
  {{ else if eq .type "in-reply-to" }}
    {{ $replies = $replies | append . }}
  {{ else if eq .type "mention-of" }}
    {{ $mentions = $mentions | append . }}
  {{ end }}
{{ end }}
{{ end }}

<div id="action-menu" class="my-4 mb-5">
    {{ partial "posts/webmention-likes" (dict
        "likes" $likes
        "page" .
        "othercount" (add (len $replies) (len $mentions))
    ) }}
    <div id="webmention-collapse" class="hidden">
        {{ partial "posts/webmention-replies" $replies }}
        {{ partial "posts/webmention-mentions" $mentions }}
    </div>

    <!-- kept for legacy pages -->
    {{ partial "posts/comment" . }}
</div>