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

github.com/zwbetz-gh/papercss-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwbetz <zwbetz@gmail.com>2019-08-24 21:05:48 +0300
committerzwbetz <zwbetz@gmail.com>2019-08-24 21:05:48 +0300
commitb00a271851a0c2b700a78bdd5eaa5803e70e89a7 (patch)
tree0c62d8c91914ad91610e54af0d7e6b7ad3595dbf
parente65e5229f3d033bcd99ae67d68b7759d883b7631 (diff)
fix list template
-rw-r--r--layouts/_default/list.html14
-rw-r--r--layouts/_default/terms.html11
-rw-r--r--layouts/index.html14
3 files changed, 27 insertions, 12 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index f0d1dea..2f70abf 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,5 +1,15 @@
{{ define "main" }}
-{{ partial "post-list.html" . }}
-
+<h1>{{ .Title }}</h1>
+{{ $pages := .Pages }}
+{{ range $pages.ByPublishDate.Reverse }}
+ <h2 class="post-list {{ if ne .Params.show_summary false }}summary{{ end }}">
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ </h2>
+ {{ if ne .Params.show_summary false }}
+ {{ .Summary }}
+ {{ end }}
+{{ end }}
{{ end }} \ No newline at end of file
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index 350f62e..6cd4bae 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -1,16 +1,11 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
-{{ $type := .Type }}
-{{ range $key, $value := .Data.Terms.ByCount }}
- {{ $name := .Name }}
- {{ $count := .Count }}
- {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
+{{ range .Data.Terms.Alphabetical }}
<h2 class="post-list">
- <span class="badge">{{ $count }}</span>
- <a href="{{ .Permalink }}">{{ $name }}</a>
+ <span class="badge">{{ .Count }}</span>
+ <a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
</h2>
- {{ end }}
{{ end }}
{{ end }} \ No newline at end of file
diff --git a/layouts/index.html b/layouts/index.html
index 7fc6411..777587f 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,5 +1,15 @@
{{ define "main" }}
-{{ partial "post-list.html" . }}
-
+<h1>{{ .Title }}</h1>
+{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+{{ range $pages.ByPublishDate.Reverse }}
+ <h2 class="post-list {{ if ne .Params.show_summary false }}summary{{ end }}">
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ </h2>
+ {{ if ne .Params.show_summary false }}
+ {{ .Summary }}
+ {{ end }}
+{{ end }}
{{ end }} \ No newline at end of file