aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-09 02:29:29 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-09 02:29:29 +0800
commit78189b25f3a92948ba214ced88a4239ce976c3c0 (patch)
treec9df8a25afdef00adb4a1331f62b8e97136491d5 /layouts/partials
parent5d02a919c6944b202d21c3ea0c633c51affae082 (diff)
downloadrhomepage-78189b25f3a92948ba214ced88a4239ce976c3c0.tar.gz
rhomepage-78189b25f3a92948ba214ced88a4239ce976c3c0.tar.xz
Add announcements section and OpenPGP key announcement
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/announcements.html15
-rw-r--r--layouts/partials/primary-nav.html1
2 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/announcements.html b/layouts/partials/announcements.html
new file mode 100644
index 0000000..f7461f8
--- /dev/null
+++ b/layouts/partials/announcements.html
@@ -0,0 +1,15 @@
+{{- $pages := where site.RegularPages "Section" "announcements" -}}
+{{- with $pages.ByDate.Reverse }}
+<section class="announcements" aria-labelledby="announcements-title">
+ <h2 id="announcements-title">ANNOUNCEMENTS</h2>
+ <ol class="document-list announcement-list">
+ {{- range first site.Params.announcementLimit . }}
+ <li>
+ <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time>
+ <a href="{{ .RelPermalink }}" lang="{{ .Params.lang }}">{{ .LinkTitle }}</a>
+ </li>
+ {{- end }}
+ </ol>
+ <p><a href="{{ "announcements/" | relURL }}">All announcements →</a></p>
+</section>
+{{- end }}
diff --git a/layouts/partials/primary-nav.html b/layouts/partials/primary-nav.html
index 05c535b..4a94d92 100644
--- a/layouts/partials/primary-nav.html
+++ b/layouts/partials/primary-nav.html
@@ -1,4 +1,5 @@
<nav class="site-nav" aria-label="Primary">
+ <a href="{{ "/announcements/" | relURL }}"{{ if eq .Section "announcements" }} aria-current="page"{{ end }}>announcements/</a>
<a href="{{ "/journal/" | relURL }}"{{ if eq .Section "journal" }} aria-current="page"{{ end }}>journal/</a>
<a href="{{ "/notes/" | relURL }}"{{ if eq .Section "notes" }} aria-current="page"{{ end }}>notes/</a>
<a href="{{ "/projects/" | relURL }}"{{ if eq .Section "projects" }} aria-current="page"{{ end }}>projects/</a>