Use .Param for cardsPerRow parameter

This commit is contained in:
vimux 2018-05-27 09:58:52 +03:00
parent b099c5e941
commit 0d5e2d839f
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@
{{ end }}
<div class="cards">
{{ range .Paginator.Pages }}
<div class="card{{ with .Site.Params.cardsPerRow }} card--{{ . }}col{{ else }} card--2col{{ end }}">
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
{{ .Render "summary" }}
</div>
{{ end }}

View file

@ -4,7 +4,7 @@
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }}
{{ range $paginator.Pages }}
<div class="card{{ with .Site.Params.cardsPerRow }} card--{{ . }}col{{ else }} card--2col{{ end }}">
<div class="card{{ if $.Param "cardsPerRow" }} card--{{ $.Param "cardsPerRow" }}col{{ else }} card--2col{{ end }}">
{{ .Render "summary" }}
</div>
{{ end }}