diff options
| author | Eltrac <hi@guhub.cn> | 2025-09-15 17:51:59 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-09-15 17:51:59 +0800 |
| commit | ff0c05ca50898b4580df52e3ed6feb4596f69090 (patch) | |
| tree | 30cc3a0c20fa7c2e52c260db6abe6d4c7474a1e8 /layouts/_partials | |
| parent | 8a036184acbafae1a06528460a3758b282ad0878 (diff) | |
refactor: replace fancybox with libra
Former-commit-id: 1bf6de58ab13fc385a24467c84b9047bddea24da
Diffstat (limited to 'layouts/_partials')
| -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 | 6 |
3 files changed, 7 insertions, 11 deletions
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..96a11bbb --- /dev/null +++ b/layouts/_partials/scripts/libra-js.html @@ -0,0 +1,6 @@ +<script type="module"> + import LightBox from '/js/libra.min.js'; + const lightbox = new LightBox({ + container: 'article' + }); +</script> |
