From cf1a85ec29a0a1bd9790eee762b6c42138141a5b Mon Sep 17 00:00:00 2001 From: budparr Date: Mon, 9 Apr 2018 10:11:55 -0400 Subject: [PATCH] Modernize placement of post list page and add some comments. By modernize I mean that Hugo formerly used the "section/section" scheme, but now we can put all related section templates in one folder. Also, more commenting! --- layouts/{section/post.html => post/list.html} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename layouts/{section/post.html => post/list.html} (53%) diff --git a/layouts/section/post.html b/layouts/post/list.html similarity index 53% rename from layouts/section/post.html rename to layouts/post/list.html index 3acc693..a662ac2 100644 --- a/layouts/section/post.html +++ b/layouts/post/list.html @@ -1,12 +1,17 @@ {{ define "main" }} +{{/* + This template is the same as the default and is here to demonstrate that if you have a content directory called "post" you can create a layouts directory, just for that section. + */}}
{{ .Content }}
- {{ $section := .Paginate (where .Data.Pages "Section" .Section) }}
- {{ range $section.Pages }} + {{ range .Pages }}
+ {{/* + Note we can use `.Render` here for items just in this section, instead of a partial to pull in items for the list page. https://gohugo.io/functions/render/ + */}} {{ .Render "summary" }}
{{ end }}