Skip to content

Infrastructure for building unversioned pages from the stable version. #1107

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

Merged
merged 11 commits into from
May 12, 2023

Conversation

AndrewJakubowicz
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz commented May 10, 2023

Issue with design and background: #1108

Testing

This was extensively manually tested. E.g., any /docs/v2 links were checked for the presence of a rel=canonical link. v1 or unversioned pages do not have rel=canonical.

Similarly cross links were checked on docs/v2/api and docs/api.

Also added some integration tests as smoke testing for the features added.

The only file changed in the move is the root `docs.json` file. Instead
a `v2.json` file was added.
@github-actions
Copy link

github-actions bot commented May 10, 2023

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr1107-132a32c---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1107-116eb04---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1107-191905a---lit-dev-5ftespv5na-uc.a.run.app/

This copies over and adds the correct permalinks to the selected
version content. Currently moving `v2` -> `unversioned`.
Unversioned links will be generated automatically by the generated
unversioned pages.
This works by piping all the content through a function that will
fix cross links on unversioned pages.
@AndrewJakubowicz AndrewJakubowicz marked this pull request as ready for review May 10, 2023 21:20
@AndrewJakubowicz AndrewJakubowicz requested review from augustjk and justinfagnani and removed request for justinfagnani and augustjk May 10, 2023 21:20
The versioned URL is stripped for unversioned URLs by our tooling.

Add a test to confirm this behavior.
Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

Great work! I only have very minor comments.

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

Amazing! I was able to build locally and navigate the site. Manually going to docs/v2/ worked great with cross links too.

Copy link
Contributor

@justinfagnani justinfagnani left a comment

Choose a reason for hiding this comment

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

Awesome work!

 - Replaced sync fs with async fs.
 - Made lightweight YAML parser more robust using regex.
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.

3 participants