From 0b221b7f8f0ecb006fc9f17e01e7689a3cc3a816 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 2 Apr 2025 14:33:40 +0800 Subject: perf: load fancybox only in single pages --- layouts/partials/scripts.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'layouts/partials/scripts.html') diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index b22c8989..dbf6aee0 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -8,9 +8,12 @@ {{- end }} -{{- $fancybox := resources.Get "js/fancybox.js" | minify }} -{{- if $fancybox }} - +{{- if or (in .Section "posts") (in .Section "cards") (in .Section "library") (eq .Type "single") }} + + {{- $fancybox := resources.Get "js/fancybox.js" | minify }} + {{- if $fancybox }} + + {{- end }} {{- end }}