Repository navigation
Remove the per-article topics fallback - #45
Merged
Merged
Conversation
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
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since meaningfool/meaningfool-writing#6, every article has a
topicsfrontmatter field. That leaves the hard-coded topics insrc/data/topics.tsas 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 thefromPrototypelist,unknownTopicIds,topicsOfand theCollectionEntryimport that onlytopicsOfused. Without the fallback,topicsOfonly returnedarticle.data.topics, so it is inlined. Kept:TOPICS(thetopicsschema insrc/content.config.tsuses it),Topic,TOPIC_NAMESand the check thattopic-map.json's topics matchTOPICS. The header comment is rewritten.src/pages/index.astro: readsarticle.data.topics. Removes theunknownTopicIdsimport and its warning loop, and the header comment now points at the frontmatter field instead ofsrc/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 fromsrc/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 insrc/data/topics.ts".I searched the repository for
fromPrototype,unknownTopicIds,topicsOfanddata/topics. Outsidedocs/redesign/prototype/, which this PR leaves alone, the only matches left are the imports ofTOPICSandTOPIC_NAMES, and the error message of the kepttopic-map.jsoncheck.Validation
Head commit:
815a56941bed7ccd0d1f92498340becc59481b85. Base:mainate8c17cc. Node 24.22.1, Bun 1.4.4. Content: the submodule at meaningfool-writingmain,c6ed223("Merge pull request #6: Give each article its topics in the frontmatter"), fetched withgit submodule update --init --remote. All 18 articles havetopics. The submodule pointer is not part of this PR, and nothing was committed in the submodule.main)bun run buildbun run builddist/diff -rq, andsha256sumof every filellms.txtandllms-full.txtdiffer only in theirGenerated:timestamps. The home'sdata-topicsare unchanged: 8ai-agents, 5product, 3product ai-agents, 1customer-success product, 1customer-success product ai-agentsbun run test:documentstopics(uncommitted submodule edit, reverted)topics:line ofthe-slicing-fallacy, thenbun run build"the-slicing-fallacy" has no topics, so picking a topic on the home's map hides it: give it a topics field.topics: ["product", "design"]onthe-slicing-fallacy, thenbun run buildInvalidContentEntryDataError … topics.1: Invalid option: expected one of "customer-success"|"product"|"ai-agents"bun run builddist/matches the "before" checksums again, apart from the twollmstimestampsPlease don't merge without the owner's go-ahead.
Generated by Claude Code