diff options
| author | BigCoke233 <hi@guhub.cn> | 2026-01-16 23:59:31 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2026-01-16 23:59:31 +0800 |
| commit | bcd509c540632b6524a8dd87a4613e64ed0402f6 (patch) | |
| tree | d55ed80119c7a72a07d7eed40c7750f63b22d42a /layouts/_partials/scripts | |
| parent | 9fab8272ca7d94841c3543eab8a4c1e91dd76b85 (diff) | |
perf: load aplayer resources only when needed
Diffstat (limited to 'layouts/_partials/scripts')
| -rw-r--r-- | layouts/_partials/scripts/aplayer-js.html | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/_partials/scripts/aplayer-js.html b/layouts/_partials/scripts/aplayer-js.html index e777b0c9..2aa3db3d 100644 --- a/layouts/_partials/scripts/aplayer-js.html +++ b/layouts/_partials/scripts/aplayer-js.html @@ -1,3 +1,4 @@ +{{ if and (not .IsHome) .Params.hasAplayer }} <script> document.addEventListener("DOMContentLoaded", function () { const lazyPlayers = document.querySelectorAll(".lazy-aplayer"); @@ -43,3 +44,4 @@ document.addEventListener("DOMContentLoaded", function () { lazyPlayers.forEach(player => observer.observe(player)); }); </script> +{{ end }} |
