summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-09-07 02:06:21 +0800
committerReorx <novoreorx@gmail.com>2022-09-07 02:06:21 +0800
commit13a2c8742c3a34ef8d137b78e5209b3d4acb02cc (patch)
tree10887f8f458b20939fdf402a3979b73772d2ca71 /layouts/_default
parentcd0381f6d3b86adb02702f1848283d9f19b017b5 (diff)
WIP: newsletter section page and archives page can work
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/archives.html11
-rw-r--r--layouts/_default/baseof.html1
-rw-r--r--layouts/_default/list.html5
3 files changed, 13 insertions, 4 deletions
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html
index 966da8a..c2e7aed 100644
--- a/layouts/_default/archives.html
+++ b/layouts/_default/archives.html
@@ -1,7 +1,7 @@
{{- define "main" }}
<header class="page-header">
- <h1>{{ .Title }}</h1>
+ <h1>{{ .Title }} !</h1>
{{- if .Description }}
<div class="post-description">
{{ .Description }}
@@ -9,7 +9,12 @@
{{- end }}
</header>
-{{- $pages := where site.AllPages "Type" "in" site.Params.mainSections }}
+{{- $sections := site.Params.mainSections }}
+{{/* with the follow condition, archives.html could be used for section archives other than the only one archives of the whole site */}}
+{{- if .Section }}
+ {{- $sections = .Section}}
+{{- end }}
+{{- $pages := where site.AllPages "Type" "in" $sections }}
{{- range $pages.GroupByPublishDate "2006" }}
{{- if ne .Key "0001" }}
@@ -22,7 +27,6 @@
<h3 class="archive-month-header">{{- .Key }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup></h3>
<div class="archive-posts">
{{- range .Pages }}
- {{- if eq .Kind "page" }}
<div class="archive-entry">
<h3 class="archive-entry-title">
{{- .Title | markdownify }}
@@ -34,7 +38,6 @@
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</div>
{{- end }}
- {{- end }}
</div>
</div>
{{- end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 513450b..e74c03e 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -13,6 +13,7 @@
{{- if eq site.Params.defaultTheme `dark` -}}
{{- print " dark" }}
{{- end -}}
+{{- block "bodyClass" . }}{{ end }}
" id="top">
{{- partialCached "header.html" . .Page -}}
<main class="main {{- if (eq .Kind `page`) -}}{{- print " post" -}}{{- end -}}">
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e2c248c..f92963d 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -13,6 +13,11 @@
{{ .Description | markdownify }}
</div>
{{- end }}
+ {{- with .Param "archivesSlug" }}
+ <div>
+ <a href="{{ $.RelPermalink }}{{ . }}/">Archives</a>
+ </div>
+ {{- end }}
</header>
{{- end }}