Replies: 2 comments
-
|
Thanks for the discussion @Yusaku01! I think for now let’s see if we merge #13538 as then no special workarounds will be needed for the link checker. If we decide to keep |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I didn’t realize there was even a PR open for 'llms.txt'! I’ll keep an eye on how it goes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
CI/CD wait times hinder development velocity. Reducing build latency is crucial, especially when frequent revisions are needed, to minimize context switching and merge conflict risks.
linkcheckand Netlify preview deployments are currently our biggest bottlenecks. I’m proposing a way to trim thelinkcheckpipeline.Problem
lint:linkcheckruns a full Astro build, includingstarlightPluginLlmsTxt(). Generatingllms.txtfiles for every page adds significant overhead, yet these files aren't even used during link verification.Points to consider
llms.txtfiles for the linkcheck process?src/content/docs/en/guides/build-with-ai.mdx) that link directly tollms.txt?Regarding point 1
If
llms.txtis required for link checking, this discussion isn't necessary, and I’ll close it.Regarding point 2
If we stop generating
llms.txt, existing direct links will trigger broken link errors. We’ll need a workaround for the linkcheck process, such as generating a dummy, emptyllms.txton the fly. Open to any other suggestions.Actual experimentation
Solution at this time
SKIP_LLMSenv var inastro.config.ts(following our existingSKIP_OGpattern).llms.txtfiles indist/post-build to avoid false-positive broken link reports.I've updated the following three files:
astro.config.ts(updated)package.json(updated)scripts/write-linkcheck-llms-stubs.mjs(added)In
astro.config.ts, I added a conditional to enable/disable the Starlightllms.txtplugin via an environment variable.For
package.json, I've setSKIP_LLMS=truefor linting. I added abuild:linkcheckscript, but I might just inline this intolint:linkchecklater.The new
scripts/write-linkcheck-llms-stubs.mjshandles generating emptyllms.txtfiles. I’m considering moving this logic intoscripts/lib/linkcheck/steps/as a proper.tsfile down the road.result
I conducted a verification in my own repository, which is a fork of withastro/docs, to see how much time would be saved by including or excluding llms.txt.
To summarize the results, excluding generating llms.txt resulted in a time reduction of approximately 20 seconds.
Related to this theme
Beta Was this translation helpful? Give feedback.
All reactions