From d9b3d6932acd8588d9a209a50d4248daa6439396 Mon Sep 17 00:00:00 2001 From: de-souza <43355143+de-souza@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:06:55 +0100 Subject: Group all templates together under _default --- layouts/_default/home.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++ layouts/index.html | 46 ---------------------------------------------- 2 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 layouts/_default/home.html delete mode 100644 layouts/index.html diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..c3425e5 --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,46 @@ +{{ define "loadshortcodes" }} + +{{/* + Here Hugo is forced to cycle through all the items that will appear on + the page, effectively pre-rendering all their shortcodes. Afterwards, + when a shortcode contains a "css" or a "js" entry in their local + .Scratch variable, the content of this entry is merged to the content + of the corresponding entry in the global .Scratch variable. +*/}} +{{ $paginator := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }} +{{ range $paginator.Pages }} +{{ with .Content }}{{ end }} +{{ with .Scratch.Get "css" }} +{{ . | merge ($.Scratch.Get "css") | $.Scratch.Set "css" }} +{{ end }} +{{ with .Scratch.Get "js" }} +{{ . | merge ($.Scratch.Get "js") | $.Scratch.Set "js" }} +{{ end }} +{{ end }} +{{ .Scratch.Set "paginator" $paginator }} + +{{ end }} + +{{ define "main" }} + +{{ $paginator := .Scratch.Get "paginator" }} +{{ range $paginator.Pages }} +
+ {{ partial "heading.html" . }} + {{ if site.Params.summaries }} + {{ .Summary }} + {{ if .Truncated }} +

+ Read More… +

+ {{ end }} + {{ else }} + {{ .Content }} + {{ end }} + {{ partial "tags.html" . }} +
+{{ with site.Params.divider }}
{{ end }} +{{ end }} +{{ partial "pagination.html" $paginator }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html deleted file mode 100644 index c3425e5..0000000 --- a/layouts/index.html +++ /dev/null @@ -1,46 +0,0 @@ -{{ define "loadshortcodes" }} - -{{/* - Here Hugo is forced to cycle through all the items that will appear on - the page, effectively pre-rendering all their shortcodes. Afterwards, - when a shortcode contains a "css" or a "js" entry in their local - .Scratch variable, the content of this entry is merged to the content - of the corresponding entry in the global .Scratch variable. -*/}} -{{ $paginator := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }} -{{ range $paginator.Pages }} -{{ with .Content }}{{ end }} -{{ with .Scratch.Get "css" }} -{{ . | merge ($.Scratch.Get "css") | $.Scratch.Set "css" }} -{{ end }} -{{ with .Scratch.Get "js" }} -{{ . | merge ($.Scratch.Get "js") | $.Scratch.Set "js" }} -{{ end }} -{{ end }} -{{ .Scratch.Set "paginator" $paginator }} - -{{ end }} - -{{ define "main" }} - -{{ $paginator := .Scratch.Get "paginator" }} -{{ range $paginator.Pages }} -
- {{ partial "heading.html" . }} - {{ if site.Params.summaries }} - {{ .Summary }} - {{ if .Truncated }} -

- Read More… -

- {{ end }} - {{ else }} - {{ .Content }} - {{ end }} - {{ partial "tags.html" . }} -
-{{ with site.Params.divider }}
{{ end }} -{{ end }} -{{ partial "pagination.html" $paginator }} - -{{ end }} -- cgit v1.2.3