Order projects only by weigth

This commit is contained in:
Hanzei 2018-06-27 11:37:23 +02:00
parent db98ff7573
commit 6b4e70a172
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
2 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@
<div class="columns is-multiline"> <div class="columns is-multiline">
{{ $totalProjects := (len .Pages) }} {{ $totalProjects := (len .Pages) }}
{{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }} {{ $numberOfProjectsToShow := .Site.Params.numberOfProjectsToShow | default $totalProjects }}
{{ range $index, $element := .Pages | first $numberOfProjectsToShow }} {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }}
{{ if eq (mod $numberOfProjectsToShow 2) 0 }} {{ if eq (mod $numberOfProjectsToShow 2) 0 }}
<div class="column is-half"> <div class="column is-half">
{{ else }} {{ else }}
@ -41,7 +41,7 @@
</div> </div>
<!-- End Projects container --> <!-- End Projects container -->
<!-- Projects modals --> <!-- Projects modals -->
{{ range $index, $element := .Pages | first $numberOfProjectsToShow }} {{ if not .Params.external_link }} {{ range $index, $element := .Pages.ByWeight | first $numberOfProjectsToShow }} {{ if not .Params.external_link }}
<div class="modal" id="modal-{{ $index }}"> <div class="modal" id="modal-{{ $index }}">
<div class="modal-background"></div> <div class="modal-background"></div>
<div class="modal-card"> <div class="modal-card">

View file

@ -17,7 +17,7 @@
<div class="section is-small"> <div class="section is-small">
<div class="columns is-multiline"> <div class="columns is-multiline">
{{ $numberOfPages := len .Pages}} {{ $numberOfPages := len .Pages}}
{{ range .Pages }} {{ range .Pages.ByWeight }}
{{ if eq (mod $numberOfPages 2) 0 }} {{ if eq (mod $numberOfPages 2) 0 }}
<div class="column is-half"> <div class="column is-half">
{{ else }} {{ else }}