mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 21:22:43 +00:00
refactor(cli): default group order to 0 and clarify meta comment
This commit is contained in:
1 parent
99a9248368
commit
b3d3c5fbc9
1 file changed
+6
-3
+6
-3
@@ -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 ────────────────────────────
|
||||||
|
|||||||
Reference in new issue
Block a user