diff options
Diffstat (limited to 'layouts')
-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 }} |