Skip to content

Commit 922a1b4

Browse files
committed
fix: remove numeric prefix from llms.txt
1 parent ba27a7f commit 922a1b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/website/src/plugins/llms-txt.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ const matter = require('gray-matter');
44

55
const DOCS_URL = 'https://commandkit.dev/docs/next/guide';
66

7+
const removeNumericPrefix = (path) => {
8+
// 01-getting-started -> getting-started
9+
return path.replace(/^\d+\-/, '');
10+
};
11+
712
module.exports = function (context) {
813
return {
914
name: 'llms-txt-plugin',
@@ -61,7 +66,7 @@ module.exports = function (context) {
6166
...allDocs
6267
.filter(doc => doc.title && doc.description)
6368
.map(doc => {
64-
const url = `${DOCS_URL}/${doc.path}`;
69+
const url = `${DOCS_URL}/${removeNumericPrefix(doc.path)}`;
6570
return `- [${doc.title}](${url}): ${doc.description || doc.title}`;
6671
})
6772
].join('\n');

0 commit comments

Comments
 (0)