summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.atom.xml3
-rw-r--r--layouts/_default/list.feed.xml3
-rw-r--r--layouts/_default/list.json.json3
-rw-r--r--layouts/index.html9
4 files changed, 13 insertions, 5 deletions
diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index b3b375d..bd1f982 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -3,7 +3,8 @@
{{- $pages := slice -}}
{{- if $.IsHome -}}
- {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections -}}
+ {{- $mainSections := site.Params.mainSections | default (slice "post") }}
+ {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}}
{{- else if $.IsSection -}}
{{- $pages = $pctx.RegularPages.ByDate.Reverse -}}
{{- else -}}
diff --git a/layouts/_default/list.feed.xml b/layouts/_default/list.feed.xml
index 0a37e09..87d62cc 100644
--- a/layouts/_default/list.feed.xml
+++ b/layouts/_default/list.feed.xml
@@ -3,7 +3,8 @@
{{- $pages := slice -}}
{{- if $.IsHome -}}
- {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections -}}
+ {{- $mainSections := site.Params.mainSections | default (slice "post") }}
+ {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}}
{{- else if $.IsSection -}}
{{- $pages = $pctx.RegularPages.ByDate.Reverse -}}
{{- else -}}
diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json
index bfcb852..308bd96 100644
--- a/layouts/_default/list.json.json
+++ b/layouts/_default/list.json.json
@@ -3,7 +3,8 @@
{{- $pages := slice -}}
{{- if $.IsHome -}}
- {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections -}}
+ {{- $mainSections := site.Params.mainSections | default (slice "post") }}
+ {{- $pages = where $pctx.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}}
{{- else if $.IsSection -}}
{{- $pages = $pctx.RegularPages.ByDate.Reverse -}}
{{- else -}}
diff --git a/layouts/index.html b/layouts/index.html
index f0f88ae..7dde6eb 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,22 +1,27 @@
{{ define "main" }}
+{{- $mainSections := site.Params.mainSections | default (slice "post") }}
{{- with .Content }}
<div class="introduction">
{{ . }}
</div>
+ {{- $section := where site.RegularPages "Section" "in" $mainSections }}
+ {{- $section_count := len $section }}
+ {{- if ge $section_count 1 }}
<hr>
<div class="toc">
{{/* TODO: Translate me */}}
<h2>Latest Publications</h2>
<ul class="texts">
- {{ range first 10 (where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections) }}
+ {{ range first 10 $section }}
<li class="text-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
+ {{ end }}
{{- else }}
- {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
+ {{ $paginator := .Paginate (where site.RegularPages "Section" "in" $mainSections) }}
<div class="articles">
{{ with .Title }}<h1 class="page-title">{{ . }}</h1>{{ end }}
{{ range $paginator.Pages }}{{- .Render "teaser" }}{{ end }}