diff --git a/assets/scss/components/_images.scss b/assets/scss/components/_images.scss
index 254eefa..efe3d1c 100644
--- a/assets/scss/components/_images.scss
+++ b/assets/scss/components/_images.scss
@@ -1,5 +1,19 @@
figure {
- margin: 2rem 0;
+ margin: 0 0 1rem;
+ display: inline-block;
+}
+
+figure img {
+ margin-bottom: 0.5rem;
+ line-height: 1;
+ max-width: 100%;
+ height: auto;
+}
+
+figure figcaption {
+ margin: 0.25rem 0 0.75rem;
+ font-size: 0.875em;
+ color: #6c757d;
}
.figure-caption {
diff --git a/config/_default/config.toml b/config/_default/config.toml
index df71fa9..75d4703 100644
--- a/config/_default/config.toml
+++ b/config/_default/config.toml
@@ -78,6 +78,9 @@ rel = "sitemap"
[[module.mounts]]
source = "static"
target = "static"
+ [[module.mounts]]
+ source = "layouts"
+ target = "layouts"
[[module.mounts]]
source = "node_modules/flexsearch"
target = "assets/js/vendor/flexsearch"
@@ -87,3 +90,6 @@ rel = "sitemap"
[[module.mounts]]
source = "node_modules/mermaid"
target = "assets/js/vendor/mermaid"
+ [[module.mounts]]
+ source = "node_modules/@hyas/images/layouts"
+ target = "layouts"
diff --git a/config/_default/params.toml b/config/_default/params.toml
index e6821b6..d80b6cb 100644
--- a/config/_default/params.toml
+++ b/config/_default/params.toml
@@ -46,12 +46,19 @@ siteLinksSearchBox = false
themeColor = "#fff"
# Images
-quality = 85
-bgColor = "#fff"
-landscapePhotoWidths = [900, 800, 700, 600, 500]
-portraitPhotoWidths = [800, 700, 600, 500]
-lqipWidth = "20x"
-smallLimit = "300"
+# quality = 85
+# bgColor = "#fff"
+# landscapePhotoWidths = [900, 800, 700, 600, 500]
+# portraitPhotoWidths = [800, 700, 600, 500]
+# lqipWidth = "20x"
+# smallLimit = "300"
+
+# Images
+imageResponsive = true
+imageConvertTo = "webp"
+imageImageSizes = ["480","720","1080","1280","1600","2048"]
+singleSize = false
+imageAddClass = "img-fluid lazyload blur-up"
# Footer
footer = "Powered by Netlify, Hugo, and Doks"
diff --git a/config/postcss.config.js b/config/postcss.config.js
index 3ab38a9..3e0eff8 100644
--- a/config/postcss.config.js
+++ b/config/postcss.config.js
@@ -23,6 +23,10 @@ module.exports = {
'container-xxl',
'container-fluid',
'offcanvas-backdrop',
+ 'img-fluid',
+ 'lazyload',
+ 'blur-up',
+ 'figcaption',
...whitelister([
'./assets/scss/components/_alerts.scss',
'./assets/scss/components/_buttons.scss',
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
deleted file mode 100644
index 4a44740..0000000
--- a/layouts/_default/_markup/render-image.html
+++ /dev/null
@@ -1,36 +0,0 @@
-{{ $image := "" -}}
-{{ if (urls.Parse .Destination).IsAbs }}
- {{ $image = resources.GetRemote .Destination -}}
-{{ else -}}
- {{ $image = .Page.Resources.GetMatch .Destination -}}
-{{ end -}}
-{{ with $image -}}
- {{ $lqip := $image.Resize site.Params.lqipWidth -}}
-
- {{ $imgSrc := "" -}}
- {{ $imgSrcSet := slice -}}
-
- {{ $widths := site.Params.landscapePhotoWidths -}}
- {{ if gt $image.Height $image.Width -}}
- {{ $widths = site.Params.portraitPhotoWidths -}}
- {{ end -}}
-
- {{ range $widths -}}
- {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}}
- {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}}
- {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}}
- {{ end -}}
- {{ $imgSrcSet = (delimit $imgSrcSet ",") -}}
-
- {{ if gt $image.Width site.Params.smallLimit -}}
-
- {{ else -}}
-
- {{ end -}}
-{{ else -}}
- {{ erroridf "image-not-found" "Image not found" -}}
-{{ end -}}
\ No newline at end of file
diff --git a/layouts/index.headers b/layouts/index.headers
index 62a645c..a44c93a 100644
--- a/layouts/index.headers
+++ b/layouts/index.headers
@@ -2,7 +2,7 @@
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
- Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self' https://*.netlify.app; connect-src 'self' https://*.netlify.app; font-src 'self' https://*.netlify.app; img-src 'self' https://*.netlify.app data:; script-src 'self' https://*.netlify.app 'sha512-RGGByJUOP98hE4wFZM78RM/3MijWJs0Tm0DbfrFhCDCXKXfDx60fii+syp5iMs3UcNX/1H4zJNgmqSejfhHrYw==' 'sha512-RBYr6Ld4w1yVqaACrgrBLQfPgGhj/1jyacA74WxJ1KM6KVcSWymwrdDwb3HDcdpwiNJ5yssot1He0U9vXoQVlg==' 'sha256-aWZ3y/RxbBYKHXH0z8+8ljrHG1mSBvyzSfxSMjBSaXk=' 'sha256-vOgyKS2vkH4n5TxBJpeh9SgzrE6LVGsAeOAvEST6oCc='; style-src 'self' https://*.netlify.app 'unsafe-inline'
+ Content-Security-Policy: default-src 'self'; frame-ancestors https://jamstackthemes.dev; manifest-src 'self' https://*.netlify.app; connect-src 'self' https://*.netlify.app; font-src 'self' https://*.netlify.app; img-src 'self' https://*.netlify.app data: https://i.giphy.com; script-src 'self' https://*.netlify.app 'sha512-RGGByJUOP98hE4wFZM78RM/3MijWJs0Tm0DbfrFhCDCXKXfDx60fii+syp5iMs3UcNX/1H4zJNgmqSejfhHrYw==' 'sha512-RBYr6Ld4w1yVqaACrgrBLQfPgGhj/1jyacA74WxJ1KM6KVcSWymwrdDwb3HDcdpwiNJ5yssot1He0U9vXoQVlg==' 'sha256-aWZ3y/RxbBYKHXH0z8+8ljrHG1mSBvyzSfxSMjBSaXk=' 'sha256-vOgyKS2vkH4n5TxBJpeh9SgzrE6LVGsAeOAvEST6oCc='; style-src 'self' https://*.netlify.app 'unsafe-inline'
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin
Feature-Policy: geolocation 'self'
diff --git a/package-lock.json b/package-lock.json
index 4c46b11..e89aedd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,6 +14,7 @@
"@babel/core": "^7.18",
"@babel/preset-env": "^7.18",
"@fullhuman/postcss-purgecss": "^4.1",
+ "@hyas/images": "^0.2.1",
"auto-changelog": "^2.4",
"autoprefixer": "^10.4",
"bootstrap": "^5.2.0-beta1",
@@ -1755,6 +1756,12 @@
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
"dev": true
},
+ "node_modules/@hyas/images": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@hyas/images/-/images-0.2.1.tgz",
+ "integrity": "sha512-OESrxH316UeTbgpDJsRS1fnoZzOIGh2+evhaaXUBrDXhg+5YT1myR7SKf00bzi1fSbQlw5+JyOmNLll/JNHxoQ==",
+ "dev": true
+ },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
@@ -8189,6 +8196,12 @@
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
"dev": true
},
+ "@hyas/images": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@hyas/images/-/images-0.2.1.tgz",
+ "integrity": "sha512-OESrxH316UeTbgpDJsRS1fnoZzOIGh2+evhaaXUBrDXhg+5YT1myR7SKf00bzi1fSbQlw5+JyOmNLll/JNHxoQ==",
+ "dev": true
+ },
"@jridgewell/gen-mapping": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
diff --git a/package.json b/package.json
index 4a92ff6..67772e4 100644
--- a/package.json
+++ b/package.json
@@ -42,6 +42,7 @@
"@babel/core": "^7.18",
"@babel/preset-env": "^7.18",
"@fullhuman/postcss-purgecss": "^4.1",
+ "@hyas/images": "^0.2.1",
"auto-changelog": "^2.4",
"autoprefixer": "^10.4",
"bootstrap": "^5.2.0-beta1",