Repository navigation
How do I wire the generators into an Astro build? #18
Answered
by
RelayStack
RelayStack
asked this question in
Q&A
|
I want llms.txt, sitemap.xml and robots.txt regenerated on every build so they never go stale. What is the recommended setup — copy the scripts into my project or use npx? |
Answered by
RelayStack
Oct 11, 2026
Replies: 1 comment
|
Both work. Recommended: keep the generators out of your source tree and pin them through npx in your build hook, so { "scripts": {
"seo": "npx -y github:RelayStack/astro-seo-toolkit astro-seo-llms --dir src/content --site https://example.com --out public/llms.txt && npx -y github:RelayStack/astro-seo-toolkit astro-seo-sitemap --dir src/content --site https://example.com --out public/sitemap.xml",
"build": "npm run seo && astro build"
} }Three details that matter:
Alternative: vendor the five |
0 replies
Answer selected by
RelayStack
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Both work. Recommended: keep the generators out of your source tree and pin them through npx in your build hook, so
public/is always fresh:{ "scripts": { "seo": "npx -y github:RelayStack/astro-seo-toolkit astro-seo-llms --dir src/content --site https://example.com --out public/llms.txt && npx -y github:RelayStack/astro-seo-toolkit astro-seo-sitemap --dir src/content --site https://example.com --out public/sitemap.xml", "build": "npm run seo && astro build" } }Three details that matter:
--dirat the content collection (src/content/...), notsrc/pages— otherwise drafts and components leak into the sitemap.