diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-21 11:32:38 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-21 11:32:38 +0300 |
commit | 68d795ed4d8dcbe160409a48f80382fbcbbaa613 (patch) | |
tree | 4a13c138c97a9dfd88f6681bb99cab5ae2ca35c9 /layouts/partials/home/projects.html | |
parent | 0de42476aedd6962e1907329983667ed68683ea7 (diff) |
Fix width of images on homepage
Diffstat (limited to 'layouts/partials/home/projects.html')
-rw-r--r-- | layouts/partials/home/projects.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html index 783e6f8..a6e82d7 100644 --- a/layouts/partials/home/projects.html +++ b/layouts/partials/home/projects.html @@ -11,17 +11,20 @@ {{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }} {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }} {{ if eq (mod $numberOfProjectsToShow 2) 0 }} + {{ .Scratch.Set "width" "490x" }} <div class="column is-half"> {{ else }} + {{ .Scratch.Set "width" "302x" }} <div class="column is-one-third"> {{ end }} <div class="card" data-target="#project-{{ $index }}"> <div class="card-image"> <figure class="image is-3by2"> <a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}> + {{ $width := ( .Scratch.Get "width" ) }} {{ with .Resources.ByType "image" }} {{ range first 1 (sort . "Params.weight") }} - {{ $image := .Resize "302x" }} + {{ $image := .Resize $width }} <img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}"> {{ end }} {{ end }} |