Skip to content

Commit f68bbae

Browse files
committed
Add llms.txt with all links
1 parent 7e82a71 commit f68bbae

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

app/llms.txt/route.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { source } from '@/lib/source';
2+
3+
export const revalidate = false;
4+
5+
const baseUrl = "https://riven.tv";
6+
7+
const getFullUrl = (url: string) => {
8+
if (url.startsWith('http://') || url.startsWith('https://')) {
9+
return url;
10+
}
11+
return baseUrl + url;
12+
}
13+
14+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15+
const treeToText = (tree: any, depth = 0): string => {
16+
17+
if (tree.children && tree.children.length > 0) {
18+
19+
let result = '#'.repeat(depth + 1) + ' ' + tree.name + '\n\n';
20+
21+
if (depth > 0) {
22+
result = "\n" + result;
23+
}
24+
25+
for (const child of tree.children) {
26+
result += treeToText(child, depth + 1);
27+
}
28+
29+
return result;
30+
}
31+
32+
if (tree.type === 'separator') {
33+
return '---\n';
34+
} else if (tree.type === 'folder') {
35+
return tree.name + ': ' + getFullUrl(tree.index.url) + ": " + tree.index.description + '\n';
36+
} else if (tree.type === 'page') {
37+
return tree.name + ': ' + getFullUrl(tree.url) + ": " + tree.description + '\n';
38+
} else {
39+
return '';
40+
}
41+
42+
}
43+
44+
export async function GET() {
45+
return new Response(treeToText(source.getPageTree()));
46+
}

content/docs/contribute.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Contribute to Wiki
3+
description: A guide on how to contribute to the Riven Wiki
34
---
45

56
Thank you for considering contributing to Riven Media! We welcome contributions from the community to help improve and expand the project. This guide will help you get started with the process of contributing.

content/docs/services/content/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Content Services
3+
description: Configuration options for content services
34
---
45

56
import { Callout } from "fumadocs-ui/components/callout"

content/docs/services/downloaders/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Downloaders
3+
description: Configuration options for supported downloaders
34
---
45

56
import { Callout } from "fumadocs-ui/components/callout"

0 commit comments

Comments
 (0)