Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Aguiar <rmaguiar@tuta.io>2021-02-24 22:30:47 +0300
committerRaphael Aguiar <rmaguiar@tuta.io>2021-02-24 22:30:47 +0300
commit6b016d23b9f5fa6917908e77920c395e68b7ddca (patch)
tree416279ca3ffa8b9a296567f47d0e173e3b0130da /layouts
parent011e93875dbbd31e6630614d0457211f3fe3f5f8 (diff)
Remove lazysizes library and minor changes
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/_markup/render-image.html50
-rw-r--r--layouts/partials/cover.html16
-rw-r--r--layouts/partials/head-style.html7
-rw-r--r--layouts/partials/head.html4
-rw-r--r--layouts/partials/katex.html12
-rw-r--r--layouts/shortcodes/figure.html17
-rw-r--r--layouts/shortcodes/img.html16
7 files changed, 23 insertions, 99 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index b58a9a2..f6c7362 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -37,28 +37,15 @@
{{ end }}
<img
- class="lazyload {{ $class }}"
+ {{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
- data-srcset='{{ delimit $outputSet ", " }}'
+ srcset='{{ delimit $outputSet ", " }}'
src="{{ $encodedPlaceholder }}"
- data-src="{{ (.Resize $mediumRes).RelPermalink }}"
width="{{ (.Resize $mediumRes).Width }}"
height="{{ (.Resize $mediumRes).Height }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
- <noscript>
- <img
- {{ with $class }}class="{{ . }}"{{ end }}
- loading="lazy"
- srcset='{{ delimit $outputSet ", " }}'
- src="{{ $encodedPlaceholder }}"
- width="{{ (.Resize $mediumRes).Width }}"
- height="{{ (.Resize $mediumRes).Height }}"
- {{ with $altText }}alt="{{ . }}"{{ end }}
- />
- </noscript>
-
{{ else }}
<!--
@@ -70,47 +57,26 @@
{{ $encodedPlaceholder := (printf "data:image/png;base64,%s" (((.Resize (printf "%vx %s" .Width "png")) | images.Filter (images.Contrast -100)).Content | base64Encode)) | safeURL }}
<img
- class="lazyload {{ $class }}"
+ {{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
- src="{{ $encodedPlaceholder }}"
- data-src="{{ $processed.RelPermalink }}"
+ src="{{ $processed.RelPermalink }}"
width="{{ .Width }}"
height="{{ .Height }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
- <noscript>
- <img
- {{ with $class }}class="{{ . }}"{{ end }}
- loading="lazy"
- src="{{ $processed.RelPermalink }}"
- width="{{ .Width }}"
- height="{{ .Height }}"
- {{ with $altText }}alt="{{ . }}"{{ end }}
- />
- </noscript>
-
{{ end }}
{{ else }}
<!-- If local file isn't found, assume it's a remote file -->
{{ with (.Destination | safeURL) }}
+
<img
- class="lazyload {{ $class }}"
+ {{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
- src="{{ $encodedPixel }}"
- data-src="{{ . }}"
+ src="{{ . }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
-
- <noscript>
- <img
- {{ with $class }}class="{{ . }}"{{ end }}
- loading="lazy"
- src="{{ . }}"
- {{ with $altText }}alt="{{ . }}"{{ end }}
- />
- </noscript>
-
+
{{ end }}
{{ end }}
diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html
index 823feac..308374c 100644
--- a/layouts/partials/cover.html
+++ b/layouts/partials/cover.html
@@ -30,25 +30,13 @@
{{ end }}
<img
- class="lazyload cover"
+ class="cover"
loading="lazy"
- data-srcset='{{ delimit $outputSet ", " }}'
+ srcset='{{ delimit $outputSet ", " }}'
src="{{ $encodedPlaceholder }}"
- data-src="{{ (.Resize $mediumRes).RelPermalink }}"
width="{{ (.Resize $mediumRes).Width }}"
height="{{ (.Resize $mediumRes).Height }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
- <noscript>
- <img
- class="cover"
- loading="lazy"
- srcset='{{ delimit $outputSet ", " }}'
- src="{{ $encodedPlaceholder }}"
- width="{{ (.Resize $mediumRes).Width }}"
- height="{{ (.Resize $mediumRes).Height }}"
- {{ with $altText }}alt="{{ . }}"{{ end }}
- />
- </noscript>
{{ end }}
diff --git a/layouts/partials/head-style.html b/layouts/partials/head-style.html
index 4f9fc32..111ec1f 100644
--- a/layouts/partials/head-style.html
+++ b/layouts/partials/head-style.html
@@ -1,6 +1,6 @@
<!-- Main CSS -->
-{{ $main := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | toCSS | minify | resources.Fingerprint "sha512" }}
-<link rel="stylesheet" href="{{ $main.RelPermalink }}" integrity="{{ $main.Data.Integrity }}">
+{{ $main := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | toCSS | minify }}
+<link rel="stylesheet" href="{{ $main.RelPermalink }}">
<!-- If JS is disabled -->
@@ -28,8 +28,7 @@
--accent: {{ if .Site.Params.Style.isDark }}{{ $darkAccent }}{{ else }}{{ $lightAccent }}{{ end }};
}
- .req-js,
- img.lazyload {
+ .req-js {
display: none;
}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index b90b08f..9a840e3 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -344,10 +344,6 @@
<!-- Preload fonts -->
{{ partialCached "font-preload" . }}
-<!-- Should be loaded even if browser has native lazy load support -->
-{{ $lazysizes := resources.Get "libs/lazysizes@5.3.0/lazysizes.min.js" | resources.ExecuteAsTemplate "js/lazysizes.min.js" . | minify | resources.Fingerprint "sha512" }}
-<script defer src="{{ $lazysizes.RelPermalink }}" crossorigin="anonymous"></script>
-
<!-- Preconnect for KaTeX -->
{{ if or .Params.katex .Site.Params.katex .Params.math .Site.Params.math }}
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin="anonymous">
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html
index 4a04b61..f988b30 100644
--- a/layouts/partials/katex.html
+++ b/layouts/partials/katex.html
@@ -1,20 +1,20 @@
<!-- KaTeX -->
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha512-h7nl+xz8wgDlNM4NqKEM4F1NkIRS17M9+uJwIGwuo8vGqIl4BhuCKdxjWEINm+xyrUjNCnK5dCrhM0sj+wTIXw==" crossorigin="anonymous">
-<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha512-/CMIhXiDA3m2c9kzRyd97MTb3MC6OVnx4TElQ7fkkoRghwDf6gi41gaT1PwF270W6+J60uTmwgeRpNpJdRV6sg==" crossorigin="anonymous"></script>
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha256-tn6hZ2YGDv0w1/DaFL4MiUoXuAVclrtFZs13ch3TB9M=" crossorigin="anonymous">
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha256-1qhJwAgsSPVSSjlQVTewHS49eaoAbOz651dveUANVBI=" crossorigin="anonymous"></script>
<!-- mhchem extension -->
{{ if or (in .Params.katexExtensions "mhchem") (in .Site.Params.katexExtensions "mhchem") }}
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/mhchem.min.js" integrity="sha512-ndr34OWlb/uvrgXcrqKXv4YUB42kRFQi9cJ+s+alNEvNBKYyIlO970xmSWYV3vNKsrT1rwW/leiBEaZxcCwjwA==" crossorigin="anonymous"></script>
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/mhchem.min.js" integrity="sha256-eI7Tty86eW+t5CeLj2o77+bKgW1jLziQASHI3lh+sn8=" crossorigin="anonymous"></script>
{{ end }}
<!-- copy-tex extension -->
{{ if or (in .Params.katexExtensions "copy-tex") (in .Site.Params.katexExtensions "copy-tex") }}
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/copy-tex.min.css" integrity="sha512-z+4JGY4AARx9M0NeGyOGL5W2gnwkPeQDiWPKcUUWOVxPiHFd9l9P0QqKaZiPv+0bWir/J9WIAEWBuRr5j8ZaWA==" crossorigin="anonymous">
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/copy-tex.min.js" integrity="sha512-DJT2Gf9zoglFWNuxgFcMZ3zi9Ra9GPDxpw9/8kyQ6cji+SOaLlV1A49Its53eLZlGfb4WjwRCptEUdNju6Wxgw==" crossorigin="anonymous"></script>
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/copy-tex.min.css" integrity="sha256-v5/0E3/sOPYlVBnhQtCIPJxSCQiF10b4Du4SsnPZs+A=" crossorigin="anonymous">
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/copy-tex.min.js" integrity="sha256-KrIjcykCG8RDmGyDJ/bmE1f7aKVOXSM9IkAjcYwCIH0=" crossorigin="anonymous"></script>
{{ end }}
<!-- auto-render extension + tabIndex HACK (see below) -->
-<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha512-Do7uJAaHZm5OLrIv/yN4w0iG1dbu01kzdMNnFfu/mAqgUk6Nniv2JYHcwH+cNwjqgLcqcuBBk+JRvprLVI8azg==" crossorigin="anonymous" onload="renderMathInElement(document.body);addTabIndex()"></script>
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha256-oEuQVLwO5Ii6subChtLbrY5gx7NDRU+UJJ9jvvau+FI=" crossorigin="anonymous" onload="renderMathInElement(document.body);addTabIndex()"></script>
<!--
HACK
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
index 9dbbfa7..a38264a 100644
--- a/layouts/shortcodes/figure.html
+++ b/layouts/shortcodes/figure.html
@@ -46,28 +46,15 @@
<figure>
<img
- class="lazyload {{ $class }}"
+ {{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
- data-srcset='{{ delimit $outputSet ", " }}'
+ srcset='{{ delimit $outputSet ", " }}'
src="{{ $encodedPlaceholder }}"
- data-src="{{ (.Resize $mediumRes).RelPermalink }}"
width="{{ (.Resize $mediumRes).Width }}"
height="{{ (.Resize $mediumRes).Height }}"
{{ with $alt }}alt="{{ . }}"{{ end }}
/>
- <noscript>
- <img
- {{ with $class }}class="{{ . }}"{{ end }}
- loading="lazy"
- srcset='{{ delimit $outputSet ", " }}'
- src="{{ $encodedPlaceholder }}"
- width="{{ (.Resize $mediumRes).Width }}"
- height="{{ (.Resize $mediumRes).Height }}"
- {{ with $alt }}alt="{{ . }}"{{ end }}
- />
- </noscript>
-
{{ with $caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index 704edb5..9976e5f 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -43,25 +43,13 @@
{{ end }}
<img
- class="lazyload {{ $class }}"
+ {{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
- data-srcset='{{ delimit $outputSet ", " }}'
+ srcset='{{ delimit $outputSet ", " }}'
src="{{ $encodedPlaceholder }}"
- data-src="{{ (.Resize $mediumRes).RelPermalink }}"
width="{{ (.Resize $mediumRes).Width }}"
height="{{ (.Resize $mediumRes).Height }}"
{{ with $altText }}alt="{{ . }}"{{ end }}
/>
- <noscript>
- <img
- {{ with $class }}class="{{ . }}"{{ end }}
- loading="lazy"
- srcset='{{ delimit $outputSet ", " }}'
- src="{{ $encodedPlaceholder }}"
- width="{{ (.Resize $mediumRes).Width }}"
- height="{{ (.Resize $mediumRes).Height }}"
- {{ with $altText }}alt="{{ . }}"{{ end }}
- />
- </noscript>
{{ end }}