Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vividvilla/ezhil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/index.html')
-rw-r--r--layouts/index.html22
1 files changed, 8 insertions, 14 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 7d617e4..adfe375 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -10,30 +10,24 @@
Recent posts
</h2>
<div class="posts">
- {{- $.Scratch.Set "counter" 0 -}}
- {{- range .Data.Pages -}}
- {{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
- {{- else -}}
- {{- if lt ($.Scratch.Get "counter") (.Site.Params.RecentPostsCount | default 10) -}}
+ {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+ {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
+ {{ range $paginator.Pages }}
<div class="post">
<div class="meta">{{ dateFormat "Jan 2, 2006" .Date }}</div>
<a class="title" href="{{ .RelPermalink }}">{{.Title}}</a> &mdash;
<span class="description">
{{ if isset .Params "description" }}
- {{ .Description }}
+ {{ .Description }}
{{ else if gt (len .RawContent) 120 }}
- {{ slicestr .RawContent 0 120 }}...
+ {{ slicestr .RawContent 0 120 }}...
{{ else }}
- {{ .RawContent }}
+ {{ .RawContent }}
{{ end }}
</span>
</div>
- {{- $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- <a href="/posts">All articles →</a>
+ {{ end }}
+ {{ template "partials/paginator.html" . }}
</div>
</div>
</div>