Skip to content

Remove the per-article topics fallback - #45

Merged
meaningfool merged 1 commit into
mainfrom
claude/friendly-cray-ayj8cs
Nov 4, 2026
Merged

meaningfool merged 1 commit into
mainfrom
claude/friendly-cray-ayj8cs

Conversation

@meaningfool

Copy link
Copy Markdown
Owner

Since meaningfool/meaningfool-writing#6, every article has a topics frontmatter field. That leaves the hard-coded topics in src/data/topics.ts as dead code that could drift from the frontmatter. This PR removes them. It's a technical change: the rendered site doesn't change.

Changes

  • src/data/topics.ts: removes the fromPrototype list, unknownTopicIds, topicsOf and the CollectionEntry import that only topicsOf used. Without the fallback, topicsOf only returned article.data.topics, so it is inlined. Kept: TOPICS (the topics schema in src/content.config.ts uses it), Topic, TOPIC_NAMES and the check that topic-map.json's topics match TOPICS. The header comment is rewritten.
  • src/pages/index.astro: reads article.data.topics. Removes the unknownTopicIds import and its warning loop, and the header comment now points at the frontmatter field instead of src/data/topics.ts. The warning for an article with no topics stays.
  • src/content.config.ts: the comment no longer says articles without the field take their topics from src/data/topics.ts. It says activity logs don't need the field and that the home warns about an article without it.
  • AGENTS.md: drops ", or else its entry in src/data/topics.ts".

I searched the repository for fromPrototype, unknownTopicIds, topicsOf and data/topics. Outside docs/redesign/prototype/, which this PR leaves alone, the only matches left are the imports of TOPICS and TOPIC_NAMES, and the error message of the kept topic-map.json check.

Validation

Head commit: 815a56941bed7ccd0d1f92498340becc59481b85. Base: main at e8c17cc. Node 24.22.1, Bun 1.4.4. Content: the submodule at meaningfool-writing main, c6ed223 ("Merge pull request #6: Give each article its topics in the frontmatter"), fetched with git submodule update --init --remote. All 18 articles have topics. The submodule pointer is not part of this PR, and nothing was committed in the submodule.

Check Command Result
Build before (main) bun run build Passes: 62 pages, no warnings
Build after (this branch) bun run build Passes: 62 pages, no warnings (the build logs differ only in timings, the image cache and Astro's "Content config changed" note)
Compare dist/ diff -rq, and sha256sum of every file 157 files on each side. 155 are byte-identical. llms.txt and llms-full.txt differ only in their Generated: timestamps. The home's data-topics are unchanged: 8 ai-agents, 5 product, 3 product ai-agents, 1 customer-success product, 1 customer-success product ai-agents
Document tests bun run test:documents 10 pass, 0 fail
Article without topics (uncommitted submodule edit, reverted) Deleted the topics: line of the-slicing-fallacy, then bun run build Passes and prints "the-slicing-fallacy" has no topics, so picking a topic on the home's map hides it: give it a topics field.
Value outside the three ids (uncommitted submodule edit, reverted) Set topics: ["product", "design"] on the-slicing-fallacy, then bun run build Fails: InvalidContentEntryDataError … topics.1: Invalid option: expected one of "customer-success"|"product"|"ai-agents"
Clean rebuild after reverting both edits bun run build Passes. dist/ matches the "before" checksums again, apart from the two llms timestamps

Please don't merge without the owner's go-ahead.


Generated by Claude Code

Every article now has its topics in the frontmatter
(meaningfool/meaningfool-writing#6), so the list of topics by article id
in src/data/topics.ts was dead code that could drift from it. Remove the
list, unknownTopicIds and its warning, and the fallback in topicsOf,
which is inlined: the home reads article.data.topics. Keep TOPICS,
Topic, TOPIC_NAMES, the check of topic-map.json, and the warning for an
article with no topics. Update the comments and AGENTS.md that pointed
at the fallback.

The rendered site is unchanged: dist/ is byte-identical apart from the
timestamps in llms.txt and llms-full.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013MdjUeqUuaqYnBoar6wxVr
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Preview: https://pr-45-meaningfool.josselin-perrus.workers.dev

Built from 815a569 with the latest content. The link stays the same and shows the latest push. Search engines are asked not to index it.

@meaningfool
meaningfool merged commit d13672c into main Nov 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants