summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-10 20:02:32 +0800
committerEltrac <hi@guhub.cn>2025-09-10 20:02:32 +0800
commit13350ec5c0e274f4591be52bd6d5ff064bfd6eb1 (patch)
tree3623f84ab903264e4f63a0fb0bb4fdb4c63019d7
parentb9febe139ef0338d807179b7ffa14af423f710ec (diff)
chore: track fancybox usage
I'm considering removing Fancybox because it loads a large JavaScript file and can significantly affects page load speed. First, I need to see if it's a frequently used feature. Former-commit-id: da5ce0b668ab96f6cc441642563e6dac59b71831
-rw-r--r--layouts/_partials/scripts/fancybox-js.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/layouts/_partials/scripts/fancybox-js.html b/layouts/_partials/scripts/fancybox-js.html
index 4823f30c..d810dd29 100644
--- a/layouts/_partials/scripts/fancybox-js.html
+++ b/layouts/_partials/scripts/fancybox-js.html
@@ -1,2 +1,10 @@
<script src="/js/fancybox.umd.js"></script>
-<script>Fancybox.bind("[data-fancybox]");</script>
+<script>
+Fancybox.bind("[data-fancybox]", {
+ on: {
+ close: () => {
+ umami.track('🖼️ Fancybox Closed');
+ },
+ },
+});
+</script>