summaryrefslogtreecommitdiff
path: root/layouts/partials/recent.html
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-08 21:30:23 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-08 21:30:23 +0800
commitbce6be90883b107285faa56acf0081b54daa3aa9 (patch)
tree0893f99b5debe074f1596b6cfc6d3c86da34ca42 /layouts/partials/recent.html
Initialize personal website
Diffstat (limited to 'layouts/partials/recent.html')
-rw-r--r--layouts/partials/recent.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/layouts/partials/recent.html b/layouts/partials/recent.html
new file mode 100644
index 0000000..47c8332
--- /dev/null
+++ b/layouts/partials/recent.html
@@ -0,0 +1,23 @@
+{{- $items := slice -}}
+{{- range where site.RegularPages "Section" "journal" -}}
+ {{- $items = $items | append (dict "page" . "kind" "journal" "sortDate" (.Date.Format "2006-01-02")) -}}
+{{- end -}}
+{{- range where site.RegularPages "Section" "notes" -}}
+ {{- $page := . -}}
+ {{- with $page.Params.recent -}}
+ {{- $items = $items | append (dict "page" $page "kind" "note" "sortDate" (time.Format "2006-01-02" .)) -}}
+ {{- end -}}
+{{- end -}}
+{{- $items = sort $items "sortDate" "desc" -}}
+<section class="recent" aria-labelledby="recent-title">
+ <h2 id="recent-title">RECENT</h2>
+ <ol class="document-list">
+ {{- range $items }}
+ <li>
+ <time datetime="{{ .sortDate }}">{{ .sortDate }}</time>
+ <span class="document-kind">[{{ .kind }}]</span>
+ <a href="{{ .page.RelPermalink }}" lang="{{ .page.Params.lang }}">{{ .page.LinkTitle }}</a>
+ </li>
+ {{- end }}
+ </ol>
+</section>