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
commitda5ce0b668ab96f6cc441642563e6dac59b71831 (patch)
tree9989d8d722250b117e4fb5082b9fd9a402f48caf
parent1e4ca50749793b4178426418d9d34a74c59d8319 (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.
-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>