From a461f6d44f994b963ffe60dec2ac4646d9029109 Mon Sep 17 00:00:00 2001 From: Reorx Date: Fri, 9 Sep 2022 11:30:49 +0800 Subject: add essays section layout --- layouts/essays/section.html | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 layouts/essays/section.html (limited to 'layouts') diff --git a/layouts/essays/section.html b/layouts/essays/section.html new file mode 100644 index 0000000..95b06e5 --- /dev/null +++ b/layouts/essays/section.html @@ -0,0 +1,70 @@ +{{- define "main" }} + + + +{{- if .Content }} +
+ {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
+{{- end }} + + +{{- $pages := .Pages }} +{{- $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 }} + +{{- $term := .Data.Term }} +{{- range $index, $page := $paginator.Pages }} + +
+

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

+ +
+ {{ .Content }} +
+
+{{- end }} + +{{- if gt $paginator.TotalPages 1 }} + +{{- end }} + +{{- end }}{{- /* end main */ -}} -- cgit v1.2.3