allow images of any ratio to be set as thumbnails without stretching them (#216)

* allow images of any ratio to be set as thumbnails without streching them

* Update _base.sass

Co-authored-by: mijorus <lorenzo@mijorus.it>
This commit is contained in:
mijorus 2020-06-24 15:31:45 +02:00 committed by GitHub
parent c4994cc895
commit ea30afa39a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -74,6 +74,11 @@ pre
.thumbnail .thumbnail
border: none border: none
.card-thumbnail
width: 100%
height: 100%
object-fit: cover
.bold-title .bold-title
font-size: 6rem font-size: 6rem
line-height: 1.2 line-height: 1.2

View file

@ -24,7 +24,7 @@
{{ with .Resources.ByType "image" }} {{ with .Resources.ByType "image" }}
{{ range first 1 (sort . "Params.weight") }} {{ range first 1 (sort . "Params.weight") }}
{{ $image := .Resize $width }} {{ $image := .Resize $width }}
<img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}"> <img class="card-thumbnail" src="{{ $image.Permalink }}" alt ="{{ $image.Name }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
</a> </a>