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

github.com/vividvilla/ezhil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri <ori@oribarbut.com>2020-02-19 07:49:01 +0300
committerOri <ori@oribarbut.com>2020-02-19 07:53:05 +0300
commitc9e27c471a4d3f5dba47a7aeaf8d408294e38b9f (patch)
tree93b6e7d6da8cb147c6d3f45904a897c947731a74
parentd680e98905f512a1245a738aef554d7770216bac (diff)
Include front matter in home and list pages if provided
Contents in `_index.md` files will be used if the relevant files exist, per hugo documentation: https://gohugo.io/templates/lists/#add-content-and-front-matter-to-list-pages
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/terms.html4
-rw-r--r--layouts/index.html2
3 files changed, 7 insertions, 1 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index a04ec31..c110ca8 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -12,6 +12,8 @@
<h1 class="page-title">All articles</h1>
{{ end }}
+ {{ with .Content }}{{ . }}{{ end }}
+
<ul class="posts">
{{- range .Data.Pages -}}
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index 940b402..6083bee 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -6,7 +6,9 @@
<div class="container wrapper tags">
{{ partial "head.html" . }}
- <h1 class="page-title">All tags</h1>
+ <h1 class="page-title">{{ .Title }}</h1>
+
+ {{ with .Content }}{{ . }}{{ end }}
{{ $biggest := 1 }}
{{ $smallest := 1 }}
diff --git a/layouts/index.html b/layouts/index.html
index 1c97468..8b02444 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -5,6 +5,8 @@
<div class="container wrapper">
{{ partial "head.html" . }}
+ {{ with .Content }}{{ . }}{{ end }}
+
<div class="recent-posts section">
<h2 class="section-header">
Recent posts