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 --- README.md | 12 ++++++++++++ archetypes/announcement.md | 8 ++++++++ content/announcements/_index.md | 9 +++++++++ content/announcements/openpgp-key-2026-2028/index.md | 17 +++++++++++++++++ hugo.toml | 3 ++- 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 + static/style.css | 12 ++++++++---- 13 files changed, 109 insertions(+), 7 deletions(-) create mode 100644 archetypes/announcement.md create mode 100644 content/announcements/_index.md create mode 100644 content/announcements/openpgp-key-2026-2028/index.md create mode 100644 layouts/announcements/list.html create mode 100644 layouts/announcements/single.html create mode 100644 layouts/partials/announcements.html diff --git a/README.md b/README.md index 750c513..11051c4 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,18 @@ make clean The source repository URL, per-file Git base URL, and public email are configured once in `hugo.toml`. +## Announcements + +Announcements are separate from journal entries and technical notes. The home page shows the latest three notices above RECENT, with the full archive at `/announcements/`. Announcements and journal entries share `/rss.xml`; RECENT continues to show only journal entries and notes. + +Create a notice with: + +```sh +hugo new content --kind announcement announcements/your-announcement/index.md +``` + +Set the title and `created` publication date, keep `updated` current when editing, and write the notice in the generated Markdown file. The home page limit is configured by `params.announcementLimit` in `hugo.toml`. + ## Licensing Site code and templates are licensed under `GPL-3.0-or-later`; see `COPYING`. diff --git a/archetypes/announcement.md b/archetypes/announcement.md new file mode 100644 index 0000000..47f0e34 --- /dev/null +++ b/archetypes/announcement.md @@ -0,0 +1,8 @@ +--- +title: "{{ replace .File.ContentBaseName "-" " " | title }}" +slug: "{{ .File.ContentBaseName }}" +lang: en +created: {{ time.Format "2006-01-02" .Date }} +updated: {{ time.Format "2006-01-02" .Date }} +license: CC-BY-SA-4.0 +--- diff --git a/content/announcements/_index.md b/content/announcements/_index.md new file mode 100644 index 0000000..64b5772 --- /dev/null +++ b/content/announcements/_index.md @@ -0,0 +1,9 @@ +--- +title: "ANNOUNCEMENTS" +lang: en +url: "/announcements/" +description: "Public notices about OpenPGP keys, contact details, and this site." +license: CC-BY-SA-4.0 +--- + +Public notices about my OpenPGP keys, contact details, and this site. diff --git a/content/announcements/openpgp-key-2026-2028/index.md b/content/announcements/openpgp-key-2026-2028/index.md new file mode 100644 index 0000000..8933853 --- /dev/null +++ b/content/announcements/openpgp-key-2026-2028/index.md @@ -0,0 +1,17 @@ +--- +title: "OpenPGP public key published (2026–2028)" +slug: "openpgp-key-2026-2028" +lang: en +created: 2026-10-09 +updated: 2026-10-09 +description: "Publication of my OpenPGP public key for 2026–2028 and its full fingerprint." +license: CC-BY-SA-4.0 +--- + +I have published my OpenPGP public key for 2026–2028. It is available from this site: + +- Public key: [richard-2026-2028.asc](/richard-2026-2028.asc) +- Fingerprint: `0D08 88B1 AC2E D6B8 29F5 D211 AEB3 28BC 83BC 2EDA` +- Validity: 2026–2028 + +The current public key and fingerprint are also linked below my introduction on the home page. Future key changes will be announced here. diff --git a/hugo.toml b/hugo.toml index 4766485..7d2a376 100644 --- a/hugo.toml +++ b/hugo.toml @@ -11,12 +11,13 @@ enableRobotsTXT = false [params] owner = "Richard Qin" identity = "richard@web:~/" - description = "Richard Qin's journal, technical notes, projects, and links." + description = "Richard Qin's journal, technical notes, announcements, projects, and links." email = "richard.qin.001@gmail.com" sourceURL = "https://git.richardqin.org/rhomepage" gitBase = "https://git.richardqin.org/rhomepage/tree" contentLicense = "CC BY-SA 4.0" recentLimit = 20 + announcementLimit = 3 [frontmatter] date = ["created"] 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 @@