aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-09 02:54:30 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-09 02:54:30 +0800
commit0535960a7dd37ebf355e44d8819c651c70ffb11f (patch)
tree3a407dc80147299149e2eaaa1a5ea71d89bc7706
parent96eaac9c58c15b8511169f26e573f360ee1714c3 (diff)
downloadrhomepage-0535960a7dd37ebf355e44d8819c651c70ffb11f.tar.gz
rhomepage-0535960a7dd37ebf355e44d8819c651c70ffb11f.tar.xz
Add RSS feed for technical note updates
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
-rw-r--r--README.md12
-rw-r--r--content/notes/_index.md1
-rw-r--r--layouts/baseof.html3
-rw-r--r--layouts/notes/list.html1
-rw-r--r--layouts/notes/list.rss.xml39
-rw-r--r--layouts/partials/footer.html4
6 files changed, 47 insertions, 13 deletions
diff --git a/README.md b/README.md
index 11051c4..750c513 100644
--- a/README.md
+++ b/README.md
@@ -20,18 +20,6 @@ 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/content/notes/_index.md b/content/notes/_index.md
index f7b6b8e..96be96a 100644
--- a/content/notes/_index.md
+++ b/content/notes/_index.md
@@ -2,6 +2,7 @@
title: "NOTES"
lang: en
url: "/notes/"
+outputs: [HTML, RSS]
description: "Topical documents maintained over time."
license: CC-BY-SA-4.0
---
diff --git a/layouts/baseof.html b/layouts/baseof.html
index 83a567e..1aa92bb 100644
--- a/layouts/baseof.html
+++ b/layouts/baseof.html
@@ -10,6 +10,9 @@
<meta name="description" content="{{ $description }}">
<link rel="canonical" href="{{ .Permalink }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.Title }} Journal and Announcements" href="{{ "rss.xml" | absURL }}">
+ {{- if eq .Section "notes" }}
+ <link rel="alternate" type="application/rss+xml" title="{{ site.Params.owner }} — Notes Updates" href="{{ "notes/rss.xml" | absURL }}">
+ {{- end }}
<link rel="stylesheet" href="{{ "style.css" | relURL }}">
<link rel="icon" href="{{ "favicon.ico" | relURL }}" sizes="any">
</head>
diff --git a/layouts/notes/list.html b/layouts/notes/list.html
index a8411e1..2bd8c67 100644
--- a/layouts/notes/list.html
+++ b/layouts/notes/list.html
@@ -7,6 +7,7 @@
</header>
{{ .Content }}
{{- if $isNotesRoot }}
+ <p><a href="{{ "notes/rss.xml" | relURL }}">Subscribe to notes updates</a></p>
{{- with .RegularPages.ByTitle }}
<section aria-labelledby="standalone-title">
<h2 id="standalone-title">STANDALONE NOTES</h2>
diff --git a/layouts/notes/list.rss.xml b/layouts/notes/list.rss.xml
new file mode 100644
index 0000000..6125ac4
--- /dev/null
+++ b/layouts/notes/list.rss.xml
@@ -0,0 +1,39 @@
+{{- $items := slice -}}
+{{- range where site.RegularPages "Section" "notes" -}}
+ {{- if not .Params.updated -}}
+ {{- errorf "Missing required updated date in %s" .File.Path -}}
+ {{- end -}}
+ {{- $sortKey := printf "%s|%s" (.Lastmod.Format "2006-01-02T15:04:05-0700") .RelPermalink -}}
+ {{- $items = $items | append (dict "page" . "sortKey" $sortKey) -}}
+{{- end -}}
+{{- $items = sort $items "sortKey" "desc" -}}
+{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ site.Params.owner }} — Notes Updates</title>
+ <link>{{ .Permalink }}</link>
+ <description>New and substantially revised technical notes by {{ site.Params.owner }}.</description>
+ <atom:link href="{{ (.OutputFormats.Get "RSS").Permalink }}" rel="self" type="application/rss+xml" />
+ {{- with $items }}
+ <lastBuildDate>{{ (index . 0).page.Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</lastBuildDate>
+ {{- end }}
+ {{- range $items }}
+ {{- $page := .page -}}
+ {{- $title := $page.Title -}}
+ {{- if $page.Params.series -}}
+ {{- $title = printf "%s — %s" $page.Parent.Title $page.Title -}}
+ {{- end -}}
+ {{- $summary := $page.Plain | strings.Truncate 200 -}}
+ {{- with $page.Params.description -}}
+ {{- $summary = . | plainify -}}
+ {{- end -}}
+ <item>
+ <title>{{ $title }}</title>
+ <link>{{ $page.Permalink }}</link>
+ <guid isPermaLink="false">{{ printf "%s#updated-%s" $page.Permalink ($page.Lastmod.Format "2006-01-02") }}</guid>
+ <pubDate>{{ $page.Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
+ <description>{{ $summary }}</description>
+ </item>
+ {{- end }}
+ </channel>
+</rss>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index ac89098..b7a9b98 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,6 +1,8 @@
<footer class="site-footer">
<nav aria-label="Site information">
- <a href="{{ "/rss.xml" | relURL }}">rss</a>
+ <a href="{{ "/rss.xml" | relURL }}">journal &amp; announcements rss</a>
+ <span aria-hidden="true">·</span>
+ <a href="{{ "/notes/rss.xml" | relURL }}">notes rss</a>
<span aria-hidden="true">·</span>
<a href="{{ site.Params.sourceURL }}">source</a>
<span aria-hidden="true">·</span>