From 3c6cb7f29631dfcdd954e7cbd5d2370efe7eb827 Mon Sep 17 00:00:00 2001 From: olOwOlo <26087907+olOwOlo@users.noreply.github.com> Date: Sun, 27 Aug 2017 22:38:42 +0800 Subject: 🎉 first commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/_default/section.html | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 layouts/_default/section.html (limited to 'layouts/_default/section.html') diff --git a/layouts/_default/section.html b/layouts/_default/section.html new file mode 100644 index 0000000..029226c --- /dev/null +++ b/layouts/_default/section.html @@ -0,0 +1,56 @@ +{{ define "title" }}{{ .Site.Data.even.default.archive }} - {{ .Site.Title }}{{ end }} + +{{ define "content"}} +{{- $lang := .Site.Data.even.default }} +{{- $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate") }} +
+ {{- if not $paginator.HasPrev }} +
+ + {{- $length := len .Data.Pages }} + {{- if eq $length 0 }} + {{ $lang.counter.archives.zero }} + {{ else }} + {{ printf $lang.counter.archives.other $length }} + {{ end -}} + +
+ {{- end -}} + + {{- range $index, $element := $paginator.Pages -}} + {{- $thisYear := $element.Date.Format "2006" }} + {{- $lastElement := $index | add -1 | index $paginator.Pages }} + {{ if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }} +
+

{{ $thisYear }}

+
+ {{- end }} + +
+ + {{ $element.Date.Format "01-02" }} + + + + {{ .Title }} + + +
+ {{- end -}} +
+ + +{{ end }} \ No newline at end of file -- cgit v1.2.3