From f09f18212e5317c181a399042081ecbabd6a0b39 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Thu, 23 Jul 2020 04:13:33 +0530 Subject: [PATCH] add index page for all posts --- layouts/_default/index.html | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 layouts/_default/index.html diff --git a/layouts/_default/index.html b/layouts/_default/index.html new file mode 100644 index 00000000..c47f81c5 --- /dev/null +++ b/layouts/_default/index.html @@ -0,0 +1,46 @@ +{{ define "main" }} +{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} +{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} + +{{ $PageContext := . }} +{{ if .IsHome }} +{{ $PageContext = .Site }} +{{ end }} +{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} + +{{- range $index, $page := $paginator.Pages }} + +{{- $class := "post-entry" }} +{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0)) }} +{{- $class = "first-entry" }} +{{- else if .Data.Term }} +{{- $class = "post-entry tag-entry" }} +{{- end }} +
+
+

{{ .Title }}

+
+
+

{{ .Summary | plainify | htmlUnescape }}...

+
+ + +
+{{- end }} + +{{- if gt $paginator.TotalPages 1 }} + +{{- end }} + +{{ end }}{{/* end main */}} \ No newline at end of file