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

github.com/zwbetz-gh/minimal-bootstrap-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 20:53:46 +0300
committerzwbetz <zwbetz@gmail.com>2019-08-24 20:53:46 +0300
commit55e1a661773e78751c9b66a60ecbb507e5bd214c (patch)
tree5722a0f0f166bb67ca6c2e1b3d647603a866b881
parent07f8e59fa7970d92687300f35de43f566c1482ae (diff)
fix list template
-rw-r--r--layouts/_default/list.html21
-rw-r--r--layouts/_default/terms.html9
-rw-r--r--layouts/index.html16
-rw-r--r--layouts/taxonomy/taxonomy.html7
-rw-r--r--layouts/taxonomy/terms.html14
5 files changed, 45 insertions, 22 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e69de29..541c711 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -0,0 +1,21 @@
+{{- define "main" -}}
+
+<h1>{{ .Title }}</h1>
+
+{{ $pages := .Pages }}
+{{ range $pages.ByPublishDate.Reverse }}
+ <p>
+ <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
+ {{ $customDateFormat := "January 2, 2006" }}
+ {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
+ <br>
+ <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
+ {{ partial "tags" . }}
+ {{ if eq .Site.Params.showPostSummary true }}
+ <br>
+ {{ .Summary }}
+ {{ end }}
+ </p>
+{{ end }}
+
+{{- end -}}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
new file mode 100644
index 0000000..a1774be
--- /dev/null
+++ b/layouts/_default/terms.html
@@ -0,0 +1,9 @@
+{{- define "main" -}}
+
+<h1>{{ .Title }}</h1>
+
+{{ range .Data.Terms.Alphabetical }}
+ <p><a href="{{ .Page.RelPermalink }}"><code>{{ .Page.Title }}</code></a> {{ .Count }}</p>
+{{ end }}
+
+{{- end -}} \ No newline at end of file
diff --git a/layouts/index.html b/layouts/index.html
index 455e6aa..11f9d83 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -8,6 +8,20 @@
{{ end }}
<h1>{{ $homepage }}</h1>
-{{ partial "post-list" . }}
+{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+{{ range $pages.ByPublishDate.Reverse }}
+ <p>
+ <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
+ {{ $customDateFormat := "January 2, 2006" }}
+ {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
+ <br>
+ <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
+ {{ partial "tags" . }}
+ {{ if eq .Site.Params.showPostSummary true }}
+ <br>
+ {{ .Summary }}
+ {{ end }}
+ </p>
+{{ end }}
{{- end -}} \ No newline at end of file
diff --git a/layouts/taxonomy/taxonomy.html b/layouts/taxonomy/taxonomy.html
deleted file mode 100644
index 5a0de4d..0000000
--- a/layouts/taxonomy/taxonomy.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{{- define "main" -}}
-
-<h1>{{ .Title }}</h1>
-
-{{ partial "post-list" . }}
-
-{{- end -}} \ No newline at end of file
diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html
deleted file mode 100644
index 8216a5d..0000000
--- a/layouts/taxonomy/terms.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{{- 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) }}
- <p><a href="{{ .Permalink }}"><code>{{ $name }}</code></a> {{ $count }}</p>
- {{ end }}
-{{ end }}
-
-{{- end -}} \ No newline at end of file