diff options
| author | Eltrac <hi@guhub.cn> | 2025-09-18 12:10:26 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-09-18 12:10:26 +0800 |
| commit | 24c0cf489fcc8b97ed6ed3834880897ec8202a92 (patch) | |
| tree | d6224b537e4104fa874dca07dafdcf52682c1573 /layouts | |
| parent | 3269cbff4d98c62d7c775237a4cbc484db25f1f0 (diff) | |
| parent | d1e065b5f203d205100067e6eec26b50007b2f6f (diff) | |
Merge branch 'master' of https://github.com/BigCoke233/geek-death-project
Former-commit-id: 123fbd207511e16acd2fcc1fb119ee3881baf826
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_markup/render-image.html | 11 | ||||
| -rw-r--r-- | layouts/_partials/scripts.html | 2 | ||||
| -rw-r--r-- | layouts/_partials/scripts/fancybox-js.html | 10 | ||||
| -rw-r--r-- | layouts/_partials/scripts/libra-js.html | 4 | ||||
| -rw-r--r-- | layouts/_shortcodes/book.html | 2 | ||||
| -rw-r--r-- | layouts/_shortcodes/bookcard.html | 2 |
6 files changed, 12 insertions, 19 deletions
diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html index e2fbfd7f..15b2a4b5 100644 --- a/layouts/_markup/render-image.html +++ b/layouts/_markup/render-image.html @@ -4,12 +4,11 @@ {{- $class := .Attributes.class | default "" -}} <figure> - <a href="{{ $src }}" data-fancybox data-caption="{{ $caption }}" class="fancybox-link"> - <img - class="lazy {{ $class }}" loading="lazy" - src="{{ $src }}" alt="{{ $alt }}" - /> - </a> + <img + class="lazy {{ $class }}" loading="lazy" + src="{{ $src }}" alt="{{ $alt }}" + data-libra + /> {{- if $caption }} <figcaption> <h4>{{ $caption | markdownify }}</h4> diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html index 414b4216..2b84ea3c 100644 --- a/layouts/_partials/scripts.html +++ b/layouts/_partials/scripts.html @@ -12,7 +12,7 @@ {{ partial "scripts/toc-js" . }} {{ partial "scripts/littlefoot-js" . }} -{{ partial "scripts/fancybox-js" . }} +{{ partial "scripts/libra-js" . }} {{ partial "scripts/aplayer-js" . }} {{ if .File }} diff --git a/layouts/_partials/scripts/fancybox-js.html b/layouts/_partials/scripts/fancybox-js.html deleted file mode 100644 index d810dd29..00000000 --- a/layouts/_partials/scripts/fancybox-js.html +++ /dev/null @@ -1,10 +0,0 @@ -<script src="/js/fancybox.umd.js"></script> -<script> -Fancybox.bind("[data-fancybox]", { - on: { - close: () => { - umami.track('🖼️ Fancybox Closed'); - }, - }, -}); -</script> diff --git a/layouts/_partials/scripts/libra-js.html b/layouts/_partials/scripts/libra-js.html new file mode 100644 index 00000000..0eea3d07 --- /dev/null +++ b/layouts/_partials/scripts/libra-js.html @@ -0,0 +1,4 @@ +<script type="module"> + import LightBox from '/js/libra.min.js'; + const lightbox = new LightBox({ offset: { x: -8 ,y: -80 } }); +</script> diff --git a/layouts/_shortcodes/book.html b/layouts/_shortcodes/book.html index 6cb0c8e8..7ea49089 100644 --- a/layouts/_shortcodes/book.html +++ b/layouts/_shortcodes/book.html @@ -1,6 +1,6 @@ <div class="book-showcase"> <div class="book-cover"> - <a href="{{ .Get "cover" }}" data-fancybox> + <a href="{{ .Get "cover" }}" data-libra> <img class="lazy" src="{{ .Get "cover" }}" loading="lazy" /> </a> </div> diff --git a/layouts/_shortcodes/bookcard.html b/layouts/_shortcodes/bookcard.html index d0fe3a4a..d128193b 100644 --- a/layouts/_shortcodes/bookcard.html +++ b/layouts/_shortcodes/bookcard.html @@ -4,7 +4,7 @@ {{- if $book }} <div class="markdown-body"> <div class="mx-auto max-w-[50%] "> - <img class="no-fancybox block w-full" src="{{ $book.Params.cover }}" /> + <img class="block w-full" src="{{ $book.Params.cover }}" /> </div> <h3 class="book-title"> <a href="{{ $book.Permalink }}">{{ $book.Title }}</a> |
