Skip to content
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

Merged
merged 6 commits into from Mar 12, 2024

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Mar 12, 2024

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 the main 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.

@huonw huonw force-pushed the huonw/174-dynamic-versioned-link branch from 733a56d to 694a872 Compare March 12, 2024 06:49
src/pages/_index.mdx Outdated Show resolved Hide resolved
@@ -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>.
Copy link
Contributor Author

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.)

@huonw huonw marked this pull request as ready for review March 12, 2024 10:15
@huonw huonw requested review from benjyw and thejcannon March 12, 2024 10:16
Copy link
Member

@thejcannon thejcannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very neat!

@huonw huonw merged commit 7477270 into pantsbuild:main Mar 12, 2024
1 check passed
@huonw huonw deleted the huonw/174-dynamic-versioned-link branch March 12, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Learn more" link on front page is hard-coded to 2.19, should be latest stable
2 participants