diff options
author | Vicky <vicky@vickylai.com> | 2018-09-03 10:59:49 +0300 |
---|---|---|
committer | Vicky <vicky@vickylai.com> | 2018-09-03 10:59:49 +0300 |
commit | ef92cd4822ea73a7dc06f2a68b8977e49a512921 (patch) | |
tree | 3066969bb4b666c15fc206fcb849058fd32660ed /layouts | |
parent | 03e80406a580dc59f5e7c99b8e18c3401462ed74 (diff) | |
parent | fe57f7d294613bce2b2af6ba2e483ddf24bb4170 (diff) |
Merge branch 'next_gen' of https://github.com/Hanzei/hugo-theme-introduction into Hanzei-next_gen
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 }} |