refactor(cli): default group order to 0 and clarify meta comment

This commit is contained in:
Prad Nukala committed 2026-09-22 13:06:20 -04:00
1 parent 99a9248368
commit b3d3c5fbc9
1 file changed
+6 -3
+6 -3
View File
@@ -196,10 +196,13 @@ async function readmeTopics(): Promise<Map<number, Topic>> {
return map; return map;
} }
/** Blume folder meta: exact topic label (the folder slug loses `/` and case) and curriculum order. */ /**
* Blume folder meta: exact topic label (the folder slug loses `/` and case) and
* curriculum order. An unplanned category group (warm-ups) has no README
* number and sorts at 0, ahead of topic 1, so the sidebar opens on the basics.
*/
function groupMeta(topic: Topic): string { function groupMeta(topic: Topic): string {
const order = topic.order === undefined ? "" : `, order: ${topic.order}`; return `import { defineMeta } from "blume";\n\nexport default defineMeta({ title: ${JSON.stringify(topic.name)}, order: ${topic.order ?? 0} });\n`;
return `import { defineMeta } from "blume";\n\nexport default defineMeta({ title: ${JSON.stringify(topic.name)}${order} });\n`;
} }
// ── inline-code formatting heuristics ──────────────────────────── // ── inline-code formatting heuristics ────────────────────────────