diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 69ce1cf..ce9dd69 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -2,6 +2,7 @@ title = "Notre-Dame de Paris" baseURL = "https://example.com" languageCode = "en-us" theme = "gohugo-theme-ananke" +themesDir = "../.." MetaDataFormat = "yaml" DefaultContentLanguage = "en" diff --git a/layouts/index.html b/layouts/index.html index 3da9bfe..90bdd02 100755 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,8 +2,10 @@
{{ .Content }}
- {{/* Create a variable to use the same section twice. Note that we've included the date here. */}} - {{ $section := where .Data.Pages.ByDate.Reverse "Section" "post" }} + {{/* For Hugo 0.20 this will default to the section with the most number of pages. */}} + {{ $mainSections := .Site.Params.mainSections | default (slice "post") }} + {{/* Create a variable to use the same section twice. */}} + {{ $section := where .Site.RegularPages "Section" "in" $mainSections }} {{ if $section }}
@@ -14,7 +16,7 @@
{{ range (first 3 $section) }}
- {{ .Render "summary-with-image" }} + {{ partial "summary-with-image.html" . }}
{{ end }}
@@ -22,7 +24,7 @@

More Posts

{{/* Nest the requirements, "after" then "first" on the outside */}} - {{ range (first 4 (after 1 $section)) }} + {{ range (first 4 (after 3 $section)) }}

{{ .Title }} diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html new file mode 100644 index 0000000..2831ae1 --- /dev/null +++ b/layouts/partials/summary-with-image.html @@ -0,0 +1,19 @@ +