AtCoderNoviSteps
AtCoderNoviSteps copied to clipboard
[SEO] llms.txtを設定しましょう
https://x.com/bubekichi/status/1939259486080041406
To implement an `llms.txt` file in a SvelteKit app, you simply need to serve a static file named `llms.txt` from your app's root so it is available at `https://yourdomain.com/llms.txt`. This is similar to serving `robots.txt` or `humans.txt`.
Here’s how you can do it:
---
### 1. Place `llms.txt` in the Static Directory
In SvelteKit, all files placed in the `static` directory are served as-is at the root of your site.
**Steps:**
1. Create a file named `llms.txt` in your project’s `static` directory.
```
your-sveltekit-project/
├── src/
├── static/
│ └── llms.txt
├── package.json
└── ...
```
2. Add your desired contents to `llms.txt`.
**Example `llms.txt`:**
User-Agent: GPTBot Allow: / Disallow: /private/
---
### 2. Accessing the File
Once you build and run your SvelteKit app, the file will be accessible at:
https://yourdomain.com/llms.txt
---
### 3. No Extra Code Needed
SvelteKit automatically serves files in the `static` directory. You don’t need to add any routes or server logic for this.
---
**Summary:**
Just put your `llms.txt` in the `static` directory. That’s all you need for a SvelteKit app!
If you need help with the contents of the file or have a more specific use case, let me know!
Claude Code の例 https://docs.anthropic.com/llms.txt