-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add VersionedDocsLink and use for evergreen links to "latest" docs page #177
Add VersionedDocsLink and use for evergreen links to "latest" docs page #177
Conversation
733a56d
to
694a872
Compare
This reverts commit 694a872.
@@ -25,7 +24,7 @@ Contributions come in many forms, and we appreciate all of them! Examples includ | |||
|
|||
Whatever your area of expertise and your skill level, there may be valuable contributions you can make. Are you a graphic designer? A technical writer? Do you know how to make videos? There might be a cool contribution in your future. | |||
|
|||
We try and make contributions easy. For example, you can suggest documentation fixes by clicking on the Suggest Edits link on any page. And you can report bugs by opening a [GitHub issue](https://github.com/pantsbuild/pants/issues). If you want to hack on the Pants codebase itself there is a <Link to={`/${versions[0]}/docs/contributions`}>helpful guide</Link>. | |||
We try and make contributions easy. For example, you can suggest documentation fixes by clicking on the Suggest Edits link on any page. And you can report bugs by opening a [GitHub issue](https://github.com/pantsbuild/pants/issues). If you want to hack on the Pants codebase itself there is a <VersionedDocsLink version="current-dev" unversionedPath="docs/contributions">helpful guide</VersionedDocsLink>. |
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.
As noted in the PR description this is changing from the first entry of versions.json
to the "current". This means switching from the most recent versioned_docs/...
entry (which corresponds to some 2.*.x
branch in https://github.com/pantsbuild/pants) to the contents of docs/
(which corresponds to main
).
I think this is reasonable: people are generally contributing to the main
branch, so the docs there are what's relevant.
(For this particular one, arguably the "process" parts of the docs like https://www.pantsbuild.org/2.20/docs/contributions are "evergreen" pages and could be moved to this repo, while some pages like https://www.pantsbuild.org/2.20/docs/contributions/development/developing-rust are more strongly tied to a particular version and so aren't evergreen.)
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.
Very neat!
This PR fixes #174 with a new
VersionedDocsLink
component that reads the docusaurus config to determine what the latest stable version is.It also adjusts the other dynamic link to the contribution guide to use this. This link is changed from the latest RC versions (currently 2.20) to the current
main
version (2.21), i.e. the absolute most up-to-date version of the contribution guide, which seems most relevant to contributors since they'll be starting in themain
branch.This has a few issues with the component due to prettier/prettier#12209, which forces us into a very long line on the
_index.mdx
page.I'm unclear if a broken link will be detected or not.