-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List posts and news sorted by date reverse
- Loading branch information
1 parent
4814e2b
commit c398cd2
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{ define "main" }} | ||
<main class="main list" role="main"> | ||
{{- with .Content }} | ||
<div class="content main__content clearfix"> | ||
{{ . }} | ||
</div> | ||
{{- end }} | ||
{{/* {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} */}} | ||
{{/* SME: order by date reverse */}} | ||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} | ||
{{ $sortedPages := $pages.ByDate.Reverse }} | ||
{{ $paginator := .Paginate $sortedPages }} | ||
{{- range $paginator.Pages }} | ||
{{- .Render "summary" }} | ||
{{- end }} | ||
{{- if and (eq $paginator.TotalNumberOfElements 0) (not $.Content) }} | ||
<div class="warning"> | ||
{{ partial "svg/files.svg" (dict "class" "warning__icon") }} | ||
<h3 class="warning__headline">{{ T "noposts_warning_title" | safeHTML }}</h3> | ||
<div class="warning__text"> | ||
<p class="warning__description">{{ T "noposts_warning_description" | safeHTML }}</p> | ||
<p class="warning__tip">{{ T "noposts_warning_tip" | safeHTML }}</p> | ||
</div> | ||
</div> | ||
{{ end }} | ||
</main> | ||
{{ partial "pagination.html" . }} | ||
{{ end }} |