Merge pull request #434 from nunocoracao/418-revert-image-processing-behaviour-fill-to-resize

️ revert image processing behaviour (.fill to .resize)
This commit is contained in:
Nuno Coração 2023-01-14 12:00:58 +00:00 committed by GitHub
commit aa4a5c3086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 6 additions and 6 deletions

View file

@ -76,7 +76,7 @@ defaultBackgroundImage = "/img/iceland.jpg"
showViews = true showViews = true
showLikes = true showLikes = true
showTableOfContents = true showTableOfContents = true
showCards = false showCards = true
groupByYear = false groupByYear = false
cardView = true cardView = true
cardViewScreenWidth = false cardViewScreenWidth = false

View file

@ -38,12 +38,12 @@ Hugo has various builtin methods to resize, crop and optimize images.
As an example - in `layouts/partials/article-link/card.html`, you have the following code: As an example - in `layouts/partials/article-link/card.html`, you have the following code:
```go ```go
{{ with .Fill "600x600" }} {{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
``` ```
The default behavior of Hugo here is to use Smartcrop to dynamically set the anchor point (crop placement) on the image and resize it to fill 600x600px. The default behavior of Hugo here is to resize the image to 600px keeping the ratio.
It is worth noting here that default image configurations such as [anchor point](https://gohugo.io/content-management/image-processing/#anchor) can also be set in your [site configuration](https://gohugo.io/content-management/image-processing/#processing-options) as well as in the template itself. It is worth noting here that default image configurations such as [anchor point](https://gohugo.io/content-management/image-processing/#anchor) can also be set in your [site configuration](https://gohugo.io/content-management/image-processing/#processing-options) as well as in the template itself.

View file

@ -19,7 +19,7 @@
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ with .Fill "600x600" }} {{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -46,7 +46,7 @@
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div> <div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ with .Fill "600x400" }} {{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div> <div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -17,7 +17,7 @@
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ else }} {{ else }}
{{ with .Fill "600x600" }} {{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }} {{ end }}
{{ end }} {{ end }}