Include .Content block (if exist) for main page

This commit is contained in:
vimux 2019-01-14 10:14:41 -05:00
parent 30e3277682
commit 326f9f2cda
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34

View file

@ -1,13 +1,18 @@
{{ define "main" }}
<main class="main">
{{- if .Content }}
<div class="page block">
{{ with .Content }}<div class="page__content page__content--notitle">{{ . }}</div>{{ end }}
</div>
{{- end }}
<div class="cards">
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }}
{{ range $paginator.Pages }}
{{- $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{- $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }}
{{- range $paginator.Pages }}
<div class="card{{ if and (ge ($.Param "columns") 1) (le ($.Param "columns") 3) }} card--{{ $.Param "columns" }}col{{ else }} card--2col{{ end }}">
{{ .Render "summary" }}
</div>
{{ end }}
{{- end }}
</div>
{{- if and (not .Site.Params.hideNoPostsWarning) (eq $paginator.TotalNumberOfElements 0) }}
<div class="empty block center">