summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-04-08 23:05:35 +0800
committereltrac <hi@eltr.ac>2026-04-08 23:05:35 +0800
commitb84df59d6486bbc52ffb971bacb81c63b7904315 (patch)
treee5af8af931e357f2ca59f7b8fe4deee38d99465f
parent7e9e39de9f8be8fcf9fde6d9545d7c22e83414da (diff)
chore: use Bunny optimizer to replace Cloudflare URL patterns
-rw-r--r--layouts/_partials/items/book.html16
1 files changed, 2 insertions, 14 deletions
diff --git a/layouts/_partials/items/book.html b/layouts/_partials/items/book.html
index 5b6e61c..d9fee4f 100644
--- a/layouts/_partials/items/book.html
+++ b/layouts/_partials/items/book.html
@@ -1,18 +1,6 @@
{{ $ctx := .ctx }}
{{ $NoViewTransition := (or .NoViewTransition false) }}
-
-<!-- Transform cover images via Cloudflare URL patterns -->
-{{ $splitURL := split $ctx.Params.cover "/" }}
-{{ $cover := "" }}
-{{ $i := 0 }}
-{{ range $splitURL }}
- {{ if eq $i 3 }}
- {{ $cover = printf "%s%s" $cover "cdn-cgi/image/width=150,quality=75/" }}
- {{ end }}
- {{ $cover = printf "%s%s/" $cover . }}
- {{ $i = add $i 1 }}
-{{ end }}
-{{ $cover = strings.TrimSuffix "/" $cover }}
+{{ $cover := printf "%s?width=300" $ctx.Params.cover }}
<div{{ if eq .Params.rating 1 }} class="opacity-50 z-0"{{ end }}
{{ if not $NoViewTransition }}style="view-transition-name: book-{{ $ctx.File.UniqueID }}"{{ end }}>
@@ -27,7 +15,7 @@
<img class="lazy w-full block min-h-[120px] bg-neutral-500" src="{{ $cover }}" />
{{ if eq $ctx.Params.rating 1 }}
<div class="absolute z-1 top-[25%] left-[25%] h-[50%] w-[50%]"
- style="background-image: url('https://r2.eltr.ac/uPic/2025/05/thumbs-down.png');
+ style="background-image: url('https://img.eltr.ac/uPic/2025/05/thumbs-down.png');
background-size: 100%;
background-position: center;
background-repeat: no-repeat;"></div>