From 6bb924eddf22bae3d9c0af87bc869e0b69abd198 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sat, 12 Oct 2024 11:58:17 +0200 Subject: [PATCH] reformat index --- layouts/index.html | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 1a9d294..127e37c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,22 +1,28 @@ -{{ define "partials/list-limited.html" }} {{/* This is not pretty but I'm not -good at templates */}} {{ $params := . | transform.Unmarshal (dict "delimiter" -";") }} {{ $fields := index $params 0 }} {{ $pageurl := index $fields 0 }} {{ -$pagename := index $fields 1 }} {{ $limit := 5 }} {{ $pages := where -site.RegularPages "Section" $pageurl }} {{- with $pages }} +{{ define "partials/list-limited.html" }} +{{/* This is not pretty but I'm not good at templates */}} +{{ $params := . | transform.Unmarshal (dict "delimiter" ";") }} +{{ $fields := index $params 0 }} +{{ $pageurl := index $fields 0 }} +{{ $pagename := index $fields 1 }} +{{ $limit := 5 }} +{{ $pages := where site.RegularPages "Section" $pageurl }} + +{{- with $pages }}

Latest {{$pagename}}

{{- range ( $pages | first $limit ) }}
- + {{ .Title }}
- {{ end }} {{ if (gt ($pages | len) $limit )}} - See more… {{ end }} + {{ if (gt ($pages | len) $limit )}}See more…{{ end }}
-{{ end }} {{ end }} {{ define "main" }} +{{ end }} + +{{ end }} + +{{ define "main" }} @@ -48,5 +54,8 @@ site.RegularPages "Section" $pageurl }} {{- with $pages }}
{{ $name }}
{{ end }} -{{ partial "list-limited.html" "posts;posts" }} {{ partial "list-limited.html" -"pages;pages" }} {{ end }} + +{{ partial "list-limited.html" "posts;posts" }} +{{ partial "list-limited.html" "pages;pages" }} + +{{ end }} \ No newline at end of file