summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2026-09-07 15:06:26 -0300
committerEuAndreh <eu@euandre.org>2026-09-07 15:06:26 -0300
commite96483085bebd564739675a2cd2f12c99de9b034 (patch)
tree3510aac50ecb2578c072538f263c1131105f7cb3
parentm (diff)
downloadeuandre.org-e96483085bebd564739675a2cd2f12c99de9b034.tar.gz
euandre.org-e96483085bebd564739675a2cd2f12c99de9b034.tar.xz
Regenerate deps.mk: read the comments once
mkwb grew a commentsdata action that reads every comment there is into one corpus, and a comments -d that reads the corpus rather than the sources. The pages wait on the corpus now; the corpus waits on the sources and on src/global.json, which it is read from. src/comments.data is built, so .gitignore takes it and clean removes it. The rendered site is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KxLpaNQThKfMG3ecCJptP9
-rw-r--r--.gitignore1
-rw-r--r--deps.mk16
2 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 4f3da55..b1fd735 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
/src/content/.gitignore
/src/comments/
/src/comments.sentinel
+/src/comments.data
!/src/comments.mastodon.json
!/src/comments.lemmy.json
diff --git a/deps.mk b/deps.mk
index 194e80f..e8c3b1f 100644
--- a/deps.mk
+++ b/deps.mk
@@ -1683,7 +1683,7 @@ FFMFLAGS = -y -hide_banner -loglevel warning
mkwb feedentry $< > $@
.json.comments:
- mkwb comments $< > $@
+ mkwb comments -d src/comments.data $< > $@
.json.mapentry:
mkwb mapentry $< > $@
@@ -1821,6 +1821,7 @@ derived-assets = \
$(sources.caslinks) \
$(sources.comments) \
src/comments.sentinel \
+ src/comments.data \
$(sources.mapentry) \
src/global.json \
$(translations.txt) \
@@ -1921,8 +1922,17 @@ src/comments.sentinel: src/comments.mbox
## cannot name in advance. Which archives those are is $comments_json
## in the site's own config, written out above; a site that holds no
## such discussion names none and waits on nothing.
-$(sources.comments): src/comments.sentinel $(comments.map)
-$(sources.comments): $(comments.archives)
+## Reading the comments is the same work whichever page asked for it
+## --- every .eml parsed, every body decoded out of quoted-printable
+## --- so it happens once here and the pages read what it wrote. The
+## sources are named as prerequisites of the corpus alone: a page waits
+## on the corpus, and the corpus waits on them.
+src/comments.data: src/comments.sentinel $(comments.map)
+src/comments.data: $(comments.archives) src/global.json
+src/comments.data:
+ mkwb commentsdata src/global.json > $@
+
+$(sources.comments): src/comments.data
## A page renders the thread belonging to it, and the site names
## which .comments that is, page by page. Every page waiting on