From ca1df7f17bee5b90cdfc2a37164eb43cb44caf11 Mon Sep 17 00:00:00 2001 From: dashdashzako Date: Mon, 2 Sep 2019 10:17:02 +0200 Subject: Replace hard-coded site pages --- layouts/index.html | 31 ++++++++++++++++--------------- layouts/post/single.html | 23 ++++++++++++----------- layouts/section/post.html | 45 +++++++++++++++++++++++---------------------- theme.toml | 3 +++ 4 files changed, 54 insertions(+), 48 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 9e13908..94380f6 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,29 +1,30 @@ - {{ partial "head.html" . }} +{{ partial "head.html" . }} - -
+ +
- {{ partial "header.html" . }} + {{ partial "header.html" . }} -
+
- {{ range first (index .Site.Params "homepageposts" | default 3) (where .Data.Pages "Type" "post") }} -
- {{ .Render "list-item-expanded" }} -
- {{ end }} + {{ range first (index .Site.Params "homepageposts" | default 3) (where site.RegularPages "Type" "in" site.Params.mainSections) }} +
+ {{ .Render "list-item-expanded" }} +
+ {{ end }} -
+
- {{ partial "nav.html" . }} + {{ partial "nav.html" . }} - {{ partial "footer.html" . }} + {{ partial "footer.html" . }} -
+
{{ partial "highlight" . }} - + + diff --git a/layouts/post/single.html b/layouts/post/single.html index e08633c..7f9a623 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,24 +1,25 @@ - {{ partial "head.html" . }} +{{ partial "head.html" . }} - -
+ +
- {{ partial "header.html" . }} + {{ partial "header.html" . }} -
- {{ .Content }} -
+
+ {{ .Content }} +
- {{ partial "nav.html" . }} + {{ partial "nav.html" . }} - {{ partial "footer.html" . }} + {{ partial "footer.html" . }} -
+
{{ partial "highlight" . }} - + + diff --git a/layouts/section/post.html b/layouts/section/post.html index b97ce86..48c6f82 100644 --- a/layouts/section/post.html +++ b/layouts/section/post.html @@ -1,38 +1,39 @@ - {{ partial "head.html" . }} +{{ partial "head.html" . }} - -
+ +
- {{ partial "header.html" . }} + {{ partial "header.html" . }} -
+
- {{ range (where .Data.Pages "Type" "post").GroupByDate "2006/01" -}} -
-

{{ .Key }}

+ {{ range (where site.RegularPages "Type" "in" site.Params.mainSections).GroupByDate "2006/01" -}} +
+

{{ .Key }}

-
    - {{ range .Pages -}} -
  1. - {{ .Render "list-item" }} -
  2. - {{ end }} -
-
- {{ end }} +
    + {{ range .Pages -}} +
  1. + {{ .Render "list-item" }} +
  2. + {{ end }} +
+
+ {{ end }} -
+
- {{ partial "nav.html" . }} + {{ partial "nav.html" . }} - {{ partial "footer.html" . }} + {{ partial "footer.html" . }} -
+
{{ partial "highlight" . }} - + + diff --git a/theme.toml b/theme.toml index aaca812..5cf6d0f 100644 --- a/theme.toml +++ b/theme.toml @@ -10,3 +10,6 @@ min_version = 0.15 [author] name = "dashdashzako" homepage = "https://github.com/dashdashzako" + +[params] + mainSections = ["post"] -- cgit v1.2.3