Skip to content

Commit

Permalink
Merge pull request #809 from h-enk/images
Browse files Browse the repository at this point in the history
Better image support
  • Loading branch information
h-enk authored Jul 5, 2022
2 parents 58d77b2 + 6c44ba0 commit 9e1f7b9
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 44 deletions.
16 changes: 15 additions & 1 deletion assets/scss/components/_images.scss
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
19 changes: 13 additions & 6 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a class=\"text-muted\" href=\"https://www.netlify.com/\">Netlify</a>, <a class=\"text-muted\" href=\"https://gohugo.io/\">Hugo</a>, and <a class=\"text-muted\" href=\"https://getdoks.org/\">Doks</a>"
Expand Down
4 changes: 4 additions & 0 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
36 changes: 0 additions & 36 deletions layouts/_default/_markup/render-image.html

This file was deleted.

2 changes: 1 addition & 1 deletion layouts/index.headers
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9e1f7b9

Please sign in to comment.