summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts/webmention-replies.html
blob: dbd2e692bda7e4e63b84590ca91a5418c2bf25eb (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{{ with . }}
<section class="flex flex-col gap-4">
    {{ range sort . ".microformats.published" }}
        {{ $mf := .microformats }}
        {{ $author := $mf.author }}
        <div class="relative">
            <header class="flex justify-between items-start">
                <div class="flex items-center gap-3">
                    <img src="{{ or (index .extra "proxied-photo") $author.photo }}" alt="Profile Picture"
                       class="h-8 w-8 rd-full" loading="lazy" />
                     <div class="text-secondary">
                      <p class="font-bold m-0">
                        <a href="{{ $author.url }}">
                            {{ replaceRE ":.*?:" "" ($author.name) }}
                        </a>
                      </p>
                      {{ $time := $mf.published }}
                      {{ $isFormated := strings.Contains $time " " }}
                      {{ if not $isFormated }}
                        {{ $t := time.AsTime $time }}
                        {{ $time = time.Format "2006-1-2 15:04" $t }}
                      {{ end }}
                      <p class="m-0"><time>{{ $time }}</time></p>
                    </div>
                </div>
                <div class="flex items-start">
                    <a href="{{ .webmention.source }}" target="_blank"
                        title="{{ T "viewExternalSource" }}"
                        data-tooltip>↗</a>
                </div>
            </header>

          <div class="max-h-[500px] overflow-y-auto overflow-x-hidden">
              <div class="webmention-body markdown-body leading-relaxed ml-3 pl-4 pr-2 b-l-4 b-l-solid b-neutral-200/50 dark:b-neutral-700/50">
                  {{ $mf.content.html | safeHTML }}
                  {{ if strings.Contains .webmention.source "https://brid.gy" }}
                    <p class="text-xs text-right text-secondary">通过 <a href="https://brid.gy/" target="_blank">Bridgy</a> 发送自联邦宇宙</p>
                  {{ end }}
              </div>
          </div>
        </div>
    {{ end }}
</section>
{{ end }}