diff options
author | amzrk2 | 2020-04-22 00:30:29 +0800 |
---|---|---|
committer | amzrk2 | 2020-04-22 00:30:29 +0800 |
commit | 2c15f4495668f953709489133073ab2e7fa2efa8 (patch) | |
tree | 355c7d213de337bf6dfae4238b1ad2fd3d3fd2fe /layouts | |
parent | 27dc1d536f212bcc1765efb5bdc72b20d2ad1286 (diff) | |
download | hugo-theme-fuji-2c15f4495668f953709489133073ab2e7fa2efa8.tar.gz hugo-theme-fuji-2c15f4495668f953709489133073ab2e7fa2efa8.tar.bz2 hugo-theme-fuji-2c15f4495668f953709489133073ab2e7fa2efa8.zip |
Change lazyload js
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/head.html | 9 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 10 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg-col.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg-row.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/lazyimg.html | 2 |
5 files changed, 7 insertions, 18 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 658030e..f34ea88 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -30,16 +30,13 @@ <link rel="stylesheet" href="{{ $style.Permalink }}"> <!-- global js --> +<script src="{{ .Site.Params.cdnJQueryJS }}"></script> +<script src="{{ .Site.Params.cdnProgessJS }}"></script> +<script src="{{ .Site.Params.cdnLazysizesAsyncJS }}" async></script> {{ if .Site.Params.webpChecker }} {{ $webp := resources.Get "js/modernizr-webp.min.js" }} <script src="{{ $webp.Permalink }}"></script> {{ end }} -{{ with .Site.Params.cdnIntersectionObserverJS }} -<script src="{{ . }}"></script> -{{ end }} -<script src="{{ .Site.Params.cdnVanillaLazyloadJS }}"></script> -<script src="{{ .Site.Params.cdnJQueryJS }}"></script> -<script src="{{ .Site.Params.cdnProgessJS }}"></script> <!-- optional katex math cdnjs --> {{ if or .Params.math .Site.Params.math }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index d734202..79befb5 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -86,12 +86,4 @@ }); }); </script> -{{ end }} -<!-- vanilla lazyload --> -<script> - $(function () { - var lazyLoadInstance = new LazyLoad({ - elements_selector: ".lazy" - }); - }); -</script>
\ No newline at end of file +{{ end }}
\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-col.html b/layouts/shortcodes/lazyimg-col.html index 0192ba5..0067762 100644 --- a/layouts/shortcodes/lazyimg-col.html +++ b/layouts/shortcodes/lazyimg-col.html @@ -1 +1 @@ -<p><img class="lazy" src="{{ .Site.Params.cdnLazyPlaceholderCol }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholderCol }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-row.html b/layouts/shortcodes/lazyimg-row.html index dd07f93..1e76de0 100644 --- a/layouts/shortcodes/lazyimg-row.html +++ b/layouts/shortcodes/lazyimg-row.html @@ -1 +1 @@ -<p><img class="lazy" src="{{ .Site.Params.cdnLazyPlaceholderRow }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholderRow }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg.html b/layouts/shortcodes/lazyimg.html index a23a15e..468a901 100644 --- a/layouts/shortcodes/lazyimg.html +++ b/layouts/shortcodes/lazyimg.html @@ -1 +1 @@ -<p><img class="lazy" src="{{ .Site.Params.cdnLazyPlaceholder }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file +<p><img class="lazyload" src="{{ .Site.Params.cdnLazyPlaceholder }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" /></p>
\ No newline at end of file |