diff options
| author | eltrac <hi@eltr.ac> | 2026-03-16 17:49:50 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-16 17:49:50 +0800 |
| commit | 5400e3008ae0e2d42355fbac23a829c081331628 (patch) | |
| tree | 08cf42fb98af7b0fe4c3359c754a51d58b44e3e6 | |
| parent | 12050c3fc9f2cda80db12b0b0ec6983f60e97354 (diff) | |
perf(webmention): use proxied photo if exists
| -rw-r--r-- | layouts/_partials/posts/webmention-mentions.html | 4 | ||||
| -rw-r--r-- | layouts/_partials/posts/webmention-summary.html | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/layouts/_partials/posts/webmention-mentions.html b/layouts/_partials/posts/webmention-mentions.html index ecfd990a..8019fe6e 100644 --- a/layouts/_partials/posts/webmention-mentions.html +++ b/layouts/_partials/posts/webmention-mentions.html @@ -5,7 +5,9 @@ {{ if index . "microformats" }} {{ $mf := index . "microformats" "properties" }} {{ $author := index (index (index $mf "author") 0) "properties" }} - <li class="flex gap-2"><img src="{{ index $author.photo 0 }}" class="h-5 w-5 rd-full w-auto inline m-0"> + {{ $photo := or (index . "extra" "proxied-photo") + (index $author.photo 0) }} + <li class="flex gap-2"><img src="{{ $photo }}" class="h-5 w-5 rd-full w-auto inline m-0"> <a href="{{ index $author.url 0 }}">{{ index $author.name 0 }}</a> <a href="{{ .webmention.source }}">{{ T "webmention.mentionedThisPost" . }}</a></li> {{ else }} diff --git a/layouts/_partials/posts/webmention-summary.html b/layouts/_partials/posts/webmention-summary.html index e1b477de..5dd6bb77 100644 --- a/layouts/_partials/posts/webmention-summary.html +++ b/layouts/_partials/posts/webmention-summary.html @@ -12,15 +12,16 @@ <div class="w-5 h-5 bg-neutral-200 dark:bg-neutral-600 flex justify-center items-center rd-full font-800">+</div> </button> - <!-- Likes --> {{ range $likes }} {{ $authors := index . "microformats" "properties" "author" }} {{ $author := index (index $authors 0) "properties" }} + {{ $photo := or (index . "extra" "proxied-photo") + (index $author.photo 0) }} <a href="{{ index $author.url 0 }}" target="_blank" title="{{ index $author.name 0 }}" class="box-border hover:no-underline inline-block h-5 w-5 float-left -ml-1"> {{ $value := math.Floor (mul math.Rand 80) }} {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} - <img src="{{ index $author.photo 0 }}" alt="Profile Picture" + <img src="{{ $photo }}" alt="Profile Picture" loading="lazy" class="h-5 w-5 rd-full transition-transform {{ if lt $rotate 0 }}group-hover:-rotate-{{ mul -1 $rotate }}{{ else }}group-hover:rotate-{{ $rotate }}{{ end }} hover:scale-150" /> </a> |
