Skip to content

Commit 6db117b

Browse files
kearfytobiemh
andauthored
Fix llms.txt (#1235)
Co-authored-by: Tobie Morgan Hitchcock <[email protected]>
1 parent c1e2cb1 commit 6db117b

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ deploy:
7777
@echo "Deploy..."
7878
aws s3 sync --region eu-west-2 --cache-control "public, max-age=31536000, immutable" --exclude '.DS_Store' --exclude '*' --include '*.webp' --content-type 'image/webp' ./dist/docs/_astro s3://www.surrealdb.com/docs/_astro/
7979
aws s3 sync --region eu-west-2 --cache-control "public, max-age=31536000, immutable" --exclude '.DS_Store' --exclude '*.webp' ./dist/docs/_astro s3://www.surrealdb.com/docs/_astro/
80+
aws s3 cp --region eu-west-2 --cache-control "public, max-age=300" ./dist/docs/llms.txt s3://www.surrealdb.com/docs/
8081
aws s3 sync --region eu-west-2 --cache-control "public, max-age=30" --delete --exclude '*' --include '*.html' ./dist/docs/ s3://www.surrealdb.com/docs/
8182

8283
.PHONY: stage
8384
stage:
8485
@echo "Stage..."
8586
aws s3 sync --region eu-west-2 --cache-control "public, max-age=31536000, immutable" --exclude '.DS_Store' --exclude '*' --include '*.webp' --content-type 'image/webp' ./dist/docs/_astro s3://www.surrealdb.dev/docs/_astro/
8687
aws s3 sync --region eu-west-2 --cache-control "public, max-age=31536000, immutable" --exclude '.DS_Store' --exclude '*.webp' ./dist/docs/_astro s3://www.surrealdb.dev/docs/_astro/
88+
aws s3 cp --region eu-west-2 --cache-control "public, max-age=86400" ./dist/docs/llms.txt s3://www.surrealdb.dev/docs/
8789
aws s3 sync --region eu-west-2 --cache-control "public, max-age=30" --delete --exclude '*' --include '*.html' ./dist/docs/ s3://www.surrealdb.dev/docs/

astro.config.mjs

-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { autolinkConfig } from './src/util/rehypeHeadingsConfig';
1414
import { rehypeNotesPlugin } from './src/util/rehypeNotesPlugin.mjs';
1515

1616
import sitemap from '@astrojs/sitemap';
17-
import llms from 'vite-plugin-llms';
1817

1918
const deployDomain = process.env.DEPLOY_DOMAIN ?? 'surrealdb.com';
2019
const site = `https://${deployDomain}`;
@@ -48,11 +47,4 @@ export default defineConfig({
4847
],
4948
syntaxHighlight: false,
5049
},
51-
vite: {
52-
plugins: [
53-
llms({
54-
llmsDir: 'llms',
55-
}),
56-
],
57-
},
5850
});

bun.lockb

-408 Bytes
Binary file not shown.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"tailwind-merge": "^2.5.4",
6060
"tailwindcss": "^3.4.15",
6161
"typescript": "^5.6.3",
62-
"unist-util-visit": "^5.0.0",
63-
"vite-plugin-llms": "^1.0.2"
62+
"unist-util-visit": "^5.0.0"
6463
},
6564
"devDependencies": {
6665
"@biomejs/biome": "1.8.3",

llms/llms.txt public/llms.txt

+16
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,19 @@ Things to remember when working with SurrealDB:
6060
- [Aeon's Surreal Renaissance](https://surrealdb.com/learn/book)
6161
- [Surreal Sidekick](https://surrealist.app/cloud/chat)
6262

63+
## Raw markdown content
64+
65+
To find the raw markdown content for a route, follow these instructions:
66+
- For a route which matches `/docs/sdk/{language}/{...path}`, you can translate it to either of:
67+
- https://raw.githubusercontent.com/surrealdb/docs.surrealdb.com/refs/heads/main/src/content/doc-sdk-{language}/{path}.md(x?)
68+
- https://raw.githubusercontent.com/surrealdb/docs.surrealdb.com/refs/heads/main/src/content/doc-sdk-{language}/{path}/index.md(x?)
69+
- For a route which matches `/docs/{doc}/{...path}`, you can translate it to either of:
70+
- https://raw.githubusercontent.com/surrealdb/docs.surrealdb.com/refs/heads/main/src/content/doc-{doc}/{path}.md(x?)
71+
- https://raw.githubusercontent.com/surrealdb/docs.surrealdb.com/refs/heads/main/src/content/doc-{doc}/{path}/index.md(x?)
72+
73+
Notice the ending file extension (`.md(x?)`), by this I mean that the file extension may be either of `.md` or `.mdx`, however `.mdx` is most likely to be the file extension.
74+
For either of the two criteria, if the ending `/{...path}` is missing, the file under the `content/doc-{...}` folder will be `index.md(x?)`
75+
76+
### Example:
77+
- Website route: /docs/sdk/javascript/data-types
78+
- Raw markdown URL: https://raw.githubusercontent.com/surrealdb/docs.surrealdb.com/refs/heads/main/src/content/doc-sdk-javascript/data-types.mdx

0 commit comments

Comments
 (0)