Skip to content

Commit be577b9

Browse files
authored
Merge pull request #388 from underctrl-io/docs
docs: fix broken links and update llms.txt
2 parents de913c0 + c67f412 commit be577b9

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

apps/website/docs/guide/15-key-value-store/01-introduction.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ npm install @commandkit/kv
7070

7171
## Next Steps
7272

73-
- [Basic Operations](./02-basic-operations.md) - Learn about core KV operations
74-
- [Namespaces](./03-namespaces.md) - Organize data with namespaces
75-
- [Advanced Features](./04-advanced-features.md) - Expiration, transactions, and more
73+
- [Basic Operations](./02-basic-operations.mdx) - Learn about core KV operations
74+
- [Namespaces](./03-namespaces.mdx) - Organize data with namespaces
75+
- [Advanced Features](./04-advanced-features.mdx) - Expiration, transactions, and more

apps/website/docs/guide/15-key-value-store/02-basic-operations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,5 +259,5 @@ if (theme !== undefined) {
259259

260260
## Next Steps
261261

262-
- [Namespaces](./03-namespaces.md) - Organize data with namespaces
263-
- [Advanced Features](./04-advanced-features.md) - Expiration, transactions, and more
262+
- [Namespaces](./03-namespaces.mdx) - Organize data with namespaces
263+
- [Advanced Features](./04-advanced-features.mdx) - Expiration, transactions, and more

apps/website/docs/guide/15-key-value-store/04-advanced-features.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,5 +396,3 @@ console.log(`Operation took ${duration.toFixed(2)}ms`);
396396
6. **Use Meaningful Keys**: Choose descriptive key names and use consistent patterns
397397
7. **Handle Errors**: Implement comprehensive error handling for all operations
398398
8. **Optimize for Your Use Case**: Use appropriate features like WAL and batch operations
399-
400-
## Next Steps

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ const path = require('path');
22
const fs = require('fs');
33
const matter = require('gray-matter');
44

5-
const DOCS_URL = 'https://commandkit.dev/docs/next/guide';
6-
7-
const removeNumericPrefix = (path) => {
8-
// 01-getting-started/01-introduction -> getting-started/introduction
9-
const segments = path.split('/');
10-
return segments.map((segment) => segment.replace(/^\d+\-/, '')).join('/');
11-
};
12-
135
module.exports = function (context) {
146
return {
157
name: 'llms-txt-plugin',
@@ -37,7 +29,7 @@ module.exports = function (context) {
3729
entry.name.endsWith('.md')
3830
) {
3931
const content = await fs.promises.readFile(fullPath, 'utf8');
40-
const { data: frontmatter } = matter(content);
32+
const { data: frontmatter, content: markdownContent } = matter(content);
4133

4234
// Get relative path from guide directory
4335
const relativePath = path
@@ -50,6 +42,7 @@ module.exports = function (context) {
5042
description: frontmatter.description,
5143
path: relativePath,
5244
version: versionPrefix,
45+
content: markdownContent,
5346
});
5447
}
5548
}
@@ -67,14 +60,13 @@ module.exports = function (context) {
6760

6861
// Generate markdown content
6962
const markdownContent = [
70-
'# CommandKit Docs\n',
63+
'# CommandKit Documentation\n\n',
7164
...allDocs
72-
.filter((doc) => doc.title && doc.description)
65+
.filter((doc) => doc.title && doc.content)
7366
.map((doc) => {
74-
const url = `${DOCS_URL}/${removeNumericPrefix(doc.path)}`;
75-
return `- [${doc.title}](${url}): ${doc.description || doc.title}`;
67+
return `## ${doc.title}\n\n${doc.content}\n\n---\n\n`;
7668
}),
77-
].join('\n');
69+
].join('');
7870

7971
// Write markdown content
8072
const llmsTxtPath = path.join(outDir, 'llms.txt');

0 commit comments

Comments
 (0)