From 78189b25f3a92948ba214ced88a4239ce976c3c0 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 9 Oct 2026 02:29:29 +0800 Subject: Add announcements section and OpenPGP key announcement --- layouts/announcements/list.html | 17 +++++++++++++++++ layouts/announcements/single.html | 17 +++++++++++++++++ layouts/baseof.html | 2 +- layouts/home.html | 1 + layouts/home.rss.xml | 2 +- layouts/partials/announcements.html | 15 +++++++++++++++ layouts/partials/primary-nav.html | 1 + 7 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 layouts/announcements/list.html create mode 100644 layouts/announcements/single.html create mode 100644 layouts/partials/announcements.html (limited to 'layouts') diff --git a/layouts/announcements/list.html b/layouts/announcements/list.html new file mode 100644 index 0000000..ed2aed8 --- /dev/null +++ b/layouts/announcements/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+ {{ partial "document-view.html" . }} +
+ {{ .Content }} +
    + {{- range .RegularPages.ByDate.Reverse }} +
  1. + + {{ .LinkTitle }} +
  2. + {{- end }} +
+
+{{ end }} diff --git a/layouts/announcements/single.html b/layouts/announcements/single.html new file mode 100644 index 0000000..45782e1 --- /dev/null +++ b/layouts/announcements/single.html @@ -0,0 +1,17 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
+
published
+
updated
+
license
{{ .Params.license }}
+
+ {{ partial "document-view.html" . }} +
+ {{ .Content }} + +
+{{ end }} diff --git a/layouts/baseof.html b/layouts/baseof.html index edc5cbe..83a567e 100644 --- a/layouts/baseof.html +++ b/layouts/baseof.html @@ -9,7 +9,7 @@ {{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }} | {{ site.Title }}{{ end }} - + diff --git a/layouts/home.html b/layouts/home.html index 826997b..a1245df 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -4,6 +4,7 @@

I'm an undergraduate at the School of Information, Renmin University of China, and a free software advocate. My current interests are MLSys, compilers, and operating systems. You can reach me by email.

OpenPGP fingerprint: 0D08 88B1 AC2E D6B8 29F5 D211 AEB3 28BC 83BC 2EDA (2026–2028)

{{ partial "primary-nav.html" . }} + {{ partial "announcements.html" . }} {{ partial "recent.html" . }} {{ end }} diff --git a/layouts/home.rss.xml b/layouts/home.rss.xml index 8ec9c25..f3d7ce3 100644 --- a/layouts/home.rss.xml +++ b/layouts/home.rss.xml @@ -1,4 +1,4 @@ -{{- $pages := where site.RegularPages "Section" "journal" -}} +{{- $pages := where site.RegularPages "Section" "in" (slice "journal" "announcements") -}} {{- $pages = $pages.ByDate.Reverse -}} {{ printf "" | safeHTML }} 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 }} +
+

ANNOUNCEMENTS

+
    + {{- range first site.Params.announcementLimit . }} +
  1. + + {{ .LinkTitle }} +
  2. + {{- end }} +
+

All announcements →

+
+{{- 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 @@