diff options
author | Hanzei <hanzei@mailbox.org> | 2018-08-30 23:06:12 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-08-30 23:06:27 +0300 |
commit | 8e5766e51f0764fdcb381c25d7511801f53de9ac (patch) | |
tree | 6429a59b4a33a049d740a14016c73acfea010c97 /layouts | |
parent | 8c70285a4736e0e24ee8f7cbe0c8e2edd94af7c0 (diff) |
Replace .Scratch with =
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/home/projects.html | 13 | ||||
-rw-r--r-- | layouts/projects/list.html | 13 |
2 files changed, 12 insertions, 14 deletions
diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html index 62d0a83..e5a28a8 100644 --- a/layouts/partials/home/projects.html +++ b/layouts/partials/home/projects.html @@ -10,18 +10,17 @@ {{ $totalProjects := (len .Pages) }} {{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }} {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }} + {{ $width := "302x" }} + {{ $columWidth := "is-one-third" }} {{ if .Site.Params.projects.useTwoColumns }} - {{ .Scratch.Set "width" "490x" }} - <div class="column is-half"> - {{ else }} - {{ .Scratch.Set "width" "302x" }} - <div class="column is-one-third"> - {{ end }} + {{ $columWidth = "is-half" }} + {{ $width = "490x" }} + {{ end}} + <div class="column {{ $columWidth }}"> <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 $width }} diff --git a/layouts/projects/list.html b/layouts/projects/list.html index a4f6e1a..37480ea 100644 --- a/layouts/projects/list.html +++ b/layouts/projects/list.html @@ -7,18 +7,17 @@ <div class="columns is-multiline"> {{ $numberOfPages := len .Pages}} {{ range .Pages.ByWeight }} + {{ $width := "302x" }} + {{ $columWidth := "is-one-third" }} {{ if .Site.Params.projects.useTwoColumns }} - {{ .Scratch.Set "width" "490x" }} - <div class="column is-half"> - {{ else }} - {{ .Scratch.Set "width" "302x" }} - <div class="column is-one-third"> - {{ end }} + {{ $columWidth = "is-half" }} + {{ $width = "490x" }} + {{ end}} + <div class="column {{ $columWidth }}"> <div class="card"> <div class="card-image"> <figure class="image is-3by2"> <a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}"> - {{ $width := ( .Scratch.Get "width" ) }} {{ with .Resources.ByType "image" }} {{ range first 1 (sort . "Params.weight") }} {{ $image := .Resize $width }} |