Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanzei <hanzei@mailbox.org>2018-07-21 11:32:38 +0300
committerHanzei <hanzei@mailbox.org>2018-07-21 11:32:38 +0300
commit68d795ed4d8dcbe160409a48f80382fbcbbaa613 (patch)
tree4a13c138c97a9dfd88f6681bb99cab5ae2ca35c9 /layouts
parent0de42476aedd6962e1907329983667ed68683ea7 (diff)
Fix width of images on homepage
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/home/projects.html5
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 }}