aboutsummaryrefslogtreecommitdiff
path: root/layouts
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
parent5d02a919c6944b202d21c3ea0c633c51affae082 (diff)
downloadrhomepage-78189b25f3a92948ba214ced88a4239ce976c3c0.tar.gz
rhomepage-78189b25f3a92948ba214ced88a4239ce976c3c0.tar.xz
Add announcements section and OpenPGP key announcement
Diffstat (limited to 'layouts')
-rw-r--r--layouts/announcements/list.html17
-rw-r--r--layouts/announcements/single.html17
-rw-r--r--layouts/baseof.html2
-rw-r--r--layouts/home.html1
-rw-r--r--layouts/home.rss.xml2
-rw-r--r--layouts/partials/announcements.html15
-rw-r--r--layouts/partials/primary-nav.html1
7 files changed, 53 insertions, 2 deletions
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" }}
+ <article lang="{{ default "en" .Params.lang }}">
+ <header class="document-header">
+ <h1>{{ .Title }}</h1>
+ {{ partial "document-view.html" . }}
+ </header>
+ {{ .Content }}
+ <ol class="document-list announcement-list">
+ {{- range .RegularPages.ByDate.Reverse }}
+ <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>
+ </article>
+{{ 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" }}
+ <article lang="{{ .Params.lang }}">
+ <header class="document-header">
+ <h1>{{ .Title }}</h1>
+ <dl class="document-meta">
+ <div><dt>published</dt><dd><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time></dd></div>
+ <div><dt>updated</dt><dd><time datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format "2006-01-02" }}</time></dd></div>
+ <div><dt>license</dt><dd>{{ .Params.license }}</dd></div>
+ </dl>
+ {{ partial "document-view.html" . }}
+ </header>
+ {{ .Content }}
+ <nav class="document-navigation" aria-label="Announcements archive">
+ <a href="{{ "announcements/" | relURL }}">← All announcements</a>
+ </nav>
+ </article>
+{{ 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 @@
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }} | {{ site.Title }}{{ end }}</title>
<meta name="description" content="{{ $description }}">
<link rel="canonical" href="{{ .Permalink }}">
- <link rel="alternate" type="application/rss+xml" title="{{ site.Title }} Journal" href="{{ "rss.xml" | absURL }}">
+ <link rel="alternate" type="application/rss+xml" title="{{ site.Title }} Journal and Announcements" href="{{ "rss.xml" | absURL }}">
<link rel="stylesheet" href="{{ "style.css" | relURL }}">
<link rel="icon" href="{{ "favicon.ico" | relURL }}" sizes="any">
</head>
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 @@
<p class="home-intro">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 <a href="mailto:{{ site.Params.email }}">email</a>.</p>
<p class="home-pgp"><a href="{{ "/richard-2026-2028.asc" | relURL }}">OpenPGP</a> fingerprint: <samp>0D08 88B1 AC2E D6B8 29F5 D211 AEB3 28BC 83BC 2EDA</samp> (2026–2028)</p>
{{ partial "primary-nav.html" . }}
+ {{ partial "announcements.html" . }}
{{ partial "recent.html" . }}
</article>
{{ 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 "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
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>