summaryrefslogtreecommitdiffstats
path: root/layouts/page/all-posts.html
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-05-29 10:40:02 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-05-29 10:40:15 +0200
commit5341773f4831960706446569675449217937aa6a (patch)
tree96a69147c1d02f0b2ddf235d0169aa0d8f60b401 /layouts/page/all-posts.html
parent8dee2d1294b1f045621ebb93b1f9407d6fccd5ec (diff)
downloadgohugo-theme-ed-5341773f4831960706446569675449217937aa6a.tar.gz
Provide ability to get list of all posts
Diffstat (limited to 'layouts/page/all-posts.html')
-rw-r--r--layouts/page/all-posts.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/layouts/page/all-posts.html b/layouts/page/all-posts.html
new file mode 100644
index 0000000..a26b084
--- /dev/null
+++ b/layouts/page/all-posts.html
@@ -0,0 +1,22 @@
+{{ define "main" }}
+{{/* Define a section to pull recent posts from.
+ This will default to the section with the most number of pages. */}}
+{{ $mainSections := site.Params.mainSections | default (slice "posts") }}
+
+{{/* Create a variable with that section to use in multiple places. */}}
+{{ $section := where site.RegularPages.ByDate.Reverse "Section" "in" $mainSections }}
+
+<div class="articles">
+ {{ with .Title }}<h1 class="page-title">{{ . }}</h1>{{ end }}
+
+ {{ with .Content }}
+ <div class="category-content">
+ {{ .Content }}
+ </div>
+ {{ end }}
+
+ {{ range $section }}
+ {{ .Render "teaser" }}
+ {{ end }}
+</div>
+{{ end }}