summaryrefslogtreecommitdiff
path: root/layouts/index.gmi
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/index.gmi')
-rw-r--r--layouts/index.gmi10
1 files changed, 9 insertions, 1 deletions
diff --git a/layouts/index.gmi b/layouts/index.gmi
index ae45ded..e629fe7 100644
--- a/layouts/index.gmi
+++ b/layouts/index.gmi
@@ -7,4 +7,12 @@
=> {{ .URL }} {{ emojify ":link:" | safeHTML }} {{ .Name | safeHTML }}
{{ end }}
## Journal Entries
-{{ partial "metadata.gmi" . }}{{ end }}
+{{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse) 1 }}
+{{- range first $entriesMinusOne (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }}
+{{- partial "metadata.gmi" . }}
+{{ end }}{{- if gt (len .Data.Pages) 1 }}
+
+{{- range last 1 (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }}
+{{- partial "metadata.gmi" . }}{{ end }}
+{{- end }}
+{{- end }}