Proposal: category-aware content identifiers
An unimplemented design for avoiding ambiguous identifiers when two categories use the same slug.
Proposal: category-aware content identifiers
This is a design proposal, not a claim that a new index has shipped. A filename is unique inside its category, but two categories may legitimately contain about.mdx. A future cross-category index needs to preserve both parts of the identity.
A small contract
const keyOf = entry => entry.category + "/" + entry.slug;
const entries = [
{ category: "docs", slug: "about" },
{ category: "ideas", slug: "about" }
];
console.log(new Set(entries.map(keyOf)).size); // 2
Search results could carry category and slug separately, build a reading URL from them, and use their composite identity as a stable key. That avoids guessing a category after a search match.
Evaluate before implementing
Create fixtures with duplicate slugs across categories, a missing category and a removed file. Check that the index resolves a result to exactly one existing entry. Then decide whether the current small filesystem loader needs an index at all.
The proposal does not promise faster search or a knowledge graph. Measure a real collection before adding caching. Keep the manually reviewed public subset as the input; an index must not become an implicit importer for private notes.
Related reading: Content format and publication policy.