Skip to content

Commit 318bedc

Browse files
committed
docs: document site file generation
1 parent 84781bd commit 318bedc

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

docs/CLAUDE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CLAUDE.md
2+
3+
Guidance for AI agents working inside the `docs/` Rails app.
4+
5+
## LLM and Sitemap Files
6+
7+
The docs app publishes these root files from `public/`:
8+
9+
- `/llms.txt`
10+
- `/llms-full.txt`
11+
- `/sitemap.xml`
12+
13+
Their source of truth is `app/lib/site_files.rb`.
14+
15+
Whenever you add, remove, or rename a public route, controller action, or view, check whether it creates or changes a public URL. If it does, update `SiteFiles` and run:
16+
17+
```bash
18+
bin/rails site_files:generate
19+
```
20+
21+
Before finishing, review the diff for `public/llms.txt`, `public/llms-full.txt`, and `public/sitemap.xml`. These generated files should be committed with the route/controller/view change so deployed apps expose the updated root files without a manual step.

docs/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ This workflow allows you to iterate quickly on components while maintaining the
2727

2828
## Site Files
2929

30-
The docs app serves `/llms.txt`, `/llms-full.txt`, and `/sitemap.xml` through Rails routes backed by `SiteFiles`.
30+
The docs app serves `/llms.txt`, `/llms-full.txt`, and `/sitemap.xml` from `public/`.
31+
Those files are generated from `app/lib/site_files.rb`, which is the source of truth for the LLM link map and sitemap URL list.
3132

32-
To refresh static copies in `public/`, run:
33+
After changing public routes, controllers, or views, update `SiteFiles` if the change adds, removes, or renames a public URL. Then refresh the generated files:
3334

3435
```bash
3536
bin/rails site_files:generate
3637
```
3738

38-
Set `SITE_FILES_OUTPUT_DIR=tmp/site_files` to generate into a temporary directory instead.
39+
Review the resulting diff in:
40+
41+
- `public/llms.txt`
42+
- `public/llms-full.txt`
43+
- `public/sitemap.xml`
44+
45+
Set `SITE_FILES_OUTPUT_DIR=tmp/site_files` to generate into a temporary directory instead of overwriting `public/`.

0 commit comments

Comments
 (0)