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" }} -{{- $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 @@

{{- .Key }}  {{ len .Pages }}

{{- range .Pages }} - {{- if eq .Kind "page" }}

{{- .Title | markdownify }} @@ -34,7 +38,6 @@

{{- end }} - {{- end }}
{{- 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 -}}
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 }} {{- end }} + {{- with .Param "archivesSlug" }} +
+ Archives +
+ {{- end }} {{- end }} diff --git a/layouts/newsletter/section.html b/layouts/newsletter/section.html new file mode 100644 index 0000000..07aab27 --- /dev/null +++ b/layouts/newsletter/section.html @@ -0,0 +1,67 @@ +{{/* section is AKA list */}} +{{- define "bodyClass" }} theme-newsletter{{- end }} + +{{- define "main" }} + + + + +{{- $pages := where .Pages "Params.hidden" "!=" true }} + +{{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}} +{{ $paginator := "" }} +{{ if (.Param "paginate") }} + {{- $paginator = .Paginate $pages (.Param "paginate") }} +{{ else }} + {{- $paginator = .Paginate $pages }} +{{ end }} + + +{{- range $index, $page := $paginator.Pages }} +
+
+

+ {{- .Title }} + {{- if .Draft }}  [Draft]{{- end }} + {{- if .Weight }}  [Pinned]{{- end }} +

+
+ {{- if (ne (.Param "hideSummary") true) }} +
+ {{ if .Description }} +

{{ .Description | plainify | htmlUnescape }}

+ {{ else }} +

{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}

+ {{ end }} +
+ {{- end }} + {{- if not (.Param "hideMeta") }} +
+ {{- partial "post_meta.html" . -}} +
+ {{- end }} + +
+{{- end }} + +{{- if gt $paginator.TotalPages 1 }} + +{{- end }} + +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1889a85..3ced6b6 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -47,10 +47,11 @@ {{- /* order is important */}} {{- $core := (slice $theme_vars $reset $common $commonHighlight $media) | resources.Concat "assets/css/core.css" }} {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }} +{{- $extendedScss := (resources.Match "css/extended/*.scss") | resources.Concat "assets/css/extended.scss" | resources.ToCSS }} {{- /* bundle all required css */}} {{- /* Add extended css after theme style */ -}} -{{- $stylesheet := (slice $core $extended) | resources.Concat "assets/css/stylesheet.css" | minify }} +{{- $stylesheet := (slice $core $extended $extendedScss) | resources.Concat "assets/css/stylesheet.css" | minify }} {{- if not site.Params.assets.disableFingerprinting }} {{- $stylesheet := $stylesheet | fingerprint }}