mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-08 22:49:44 +00:00
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:
parent
c4994cc895
commit
ea30afa39a
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue