mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-21 19:42:52 +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
|
||||
border: none
|
||||
|
||||
.card-thumbnail
|
||||
width: 100%
|
||||
height: 100%
|
||||
object-fit: cover
|
||||
|
||||
.bold-title
|
||||
font-size: 6rem
|
||||
line-height: 1.2
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{{ with .Resources.ByType "image" }}
|
||||
{{ range first 1 (sort . "Params.weight") }}
|
||||
{{ $image := .Resize $width }}
|
||||
<img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}">
|
||||
<img class="card-thumbnail" src="{{ $image.Permalink }}" alt ="{{ $image.Name }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue