diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-09-10 00:41:20 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-09-10 00:41:20 +0800 |
| commit | 4712b4f2c8980ca80c776d509e9f02cfcbcea3f6 (patch) | |
| tree | 84cfa7e1e8cb911adb7e6b5065d45a76e28c033e /layouts/partials/updated-items.html | |
| parent | 3ecfb36aa76469d22a007935118a9f72506ae6bf (diff) | |
| download | rhomepage-4712b4f2c8980ca80c776d509e9f02cfcbcea3f6.tar.gz rhomepage-4712b4f2c8980ca80c776d509e9f02cfcbcea3f6.tar.xz | |
Add updated document archive
Diffstat (limited to 'layouts/partials/updated-items.html')
| -rw-r--r-- | layouts/partials/updated-items.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/updated-items.html b/layouts/partials/updated-items.html new file mode 100644 index 0000000..5f738a8 --- /dev/null +++ b/layouts/partials/updated-items.html @@ -0,0 +1,16 @@ +{{- $items := slice -}} +{{- range $section := slice "journal" "notes" -}} + {{- $kind := cond (eq $section "notes") "note" "journal" -}} + {{- range where site.RegularPages "Section" $section -}} + {{- if not .Params.created -}} + {{- errorf "Missing required created date in %s" .File.Path -}} + {{- end -}} + {{- if not .Params.updated -}} + {{- errorf "Missing required updated date in %s" .File.Path -}} + {{- end -}} + {{- $sortDate := time.Format "2006-01-02" .Params.updated -}} + {{- $sortKey := printf "%s|%s" $sortDate .RelPermalink -}} + {{- $items = $items | append (dict "page" . "kind" $kind "sortDate" $sortDate "sortKey" $sortKey) -}} + {{- end -}} +{{- end -}} +{{- return (sort $items "sortKey" "desc") -}} |
