-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add docs_version configuration for RTD publications #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks, that makes sense. I'd just rename |
|
Oh, great, thanks @pawamoy I am glad it made sense (for a technical writer, I was struggling to explain what I was trying to achieve with this). Certainly, I'll make those changes tomorrow and submit them. Thanks again! |
|
OK, that's all done. Please let me know if you need anything else from me, and thank you again. |
pawamoy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looking good! Just some nits that I'll batch-apply.
Summary
For docs that publish to versioned paths, it isn't sufficient to use the
site_urlpath to build URLs forllms.txtbecause that will always default to one version, mostlystable. That means thellms.txtwill build linkes for each file that point to stable. For older versions, this doesn't work, since it means the llms.txt gets out of sync, and points into docs for current stable builds, rather than the build they actually accompany.We cannot rely on updating
site_urlto set it to a particular version for each build either, since MkDocs uses it as a canonical link and it needs to stay pointing tostableforever.I've instead introduced a new configuration variable in the plugin called
docs_version, which is used in preference ofsite_urlif it is present.I've updated the docs.
Changes
config.pyto adddocs_versionplugin.pyto add if/else switch to select versioned URL if it's presentPlease let me know what you think @pawamoy!
I'm not a Python developer so I hope this is OK for you.
We publish the Vizro docs but we aren't able to version each
llms.txtto our needs. This solves our problem, and probably that for other RTD publications that care about having allms.txtavailable for every version of their docs. We will still only have thestableversion at the root, but plan to link each version of the docs to the appropriate version ofllms.txtthat's built and stored in the root of that version.For example, at present, see our
llms.txtfor an older version of Vizro (0.1.45) that is no longer thestableversion: https://vizro.readthedocs.io/en/0.1.45/llms.txt. It's unfortunately pointing tostableversions of the pages. My change here should fix that.LMK if you need further information or for me to edit this PR description!