Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/damiencaselli/paperback.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordashdashzako <d@dashdashzako.net>2019-09-02 11:17:02 +0300
committerdashdashzako <d@dashdashzako.net>2019-09-02 11:17:02 +0300
commitca1df7f17bee5b90cdfc2a37164eb43cb44caf11 (patch)
tree81d6e22bc979c6bf4d3658a9e9eb6ace35124522
parent24f5285851775057bf5e6a18695883eb46089d5c (diff)
Replace hard-coded site pages
-rw-r--r--layouts/index.html31
-rw-r--r--layouts/post/single.html23
-rw-r--r--layouts/section/post.html45
-rw-r--r--theme.toml3
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 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
- {{ partial "head.html" . }}
+{{ partial "head.html" . }}
- <body>
- <div class="container">
+<body>
+ <div class="container">
- {{ partial "header.html" . }}
+ {{ partial "header.html" . }}
- <section>
+ <section>
- {{ range first (index .Site.Params "homepageposts" | default 3) (where .Data.Pages "Type" "post") }}
- <article>
- {{ .Render "list-item-expanded" }}
- </article>
- {{ end }}
+ {{ range first (index .Site.Params "homepageposts" | default 3) (where site.RegularPages "Type" "in" site.Params.mainSections) }}
+ <article>
+ {{ .Render "list-item-expanded" }}
+ </article>
+ {{ end }}
- </section>
+ </section>
- {{ partial "nav.html" . }}
+ {{ partial "nav.html" . }}
- {{ partial "footer.html" . }}
+ {{ partial "footer.html" . }}
- </div>
+ </div>
{{ partial "highlight" . }}
- </body>
+</body>
+
</html>
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 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
- {{ partial "head.html" . }}
+{{ partial "head.html" . }}
- <body>
- <div class="container">
+<body>
+ <div class="container">
- {{ partial "header.html" . }}
+ {{ partial "header.html" . }}
- <article>
- {{ .Content }}
- </article>
+ <article>
+ {{ .Content }}
+ </article>
- {{ partial "nav.html" . }}
+ {{ partial "nav.html" . }}
- {{ partial "footer.html" . }}
+ {{ partial "footer.html" . }}
- </div>
+ </div>
{{ partial "highlight" . }}
- </body>
+</body>
+
</html>
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 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
- {{ partial "head.html" . }}
+{{ partial "head.html" . }}
- <body>
- <div class="container">
+<body>
+ <div class="container">
- {{ partial "header.html" . }}
+ {{ partial "header.html" . }}
- <article>
+ <article>
- {{ range (where .Data.Pages "Type" "post").GroupByDate "2006/01" -}}
- <section>
- <h2>{{ .Key }}</h2>
+ {{ range (where site.RegularPages "Type" "in" site.Params.mainSections).GroupByDate "2006/01" -}}
+ <section>
+ <h2>{{ .Key }}</h2>
- <ol>
- {{ range .Pages -}}
- <li>
- {{ .Render "list-item" }}
- </li>
- {{ end }}
- </ol>
- </section>
- {{ end }}
+ <ol>
+ {{ range .Pages -}}
+ <li>
+ {{ .Render "list-item" }}
+ </li>
+ {{ end }}
+ </ol>
+ </section>
+ {{ end }}
- </article>
+ </article>
- {{ partial "nav.html" . }}
+ {{ partial "nav.html" . }}
- {{ partial "footer.html" . }}
+ {{ partial "footer.html" . }}
- </div>
+ </div>
{{ partial "highlight" . }}
- </body>
+</body>
+
</html>
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"]