-
Notifications
You must be signed in to change notification settings - Fork 120
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 docs versioning #310
Add docs versioning #310
Conversation
- Responds to event dispatched by monorepo workflow - storybookjs/storybook#16580
c162580
to
48c4fb0
Compare
I approved the Chromatic checks myself as the visual changes are identical (literally copy/pasted the code) to those already approved in #298. |
48c4fb0
to
7ee6b33
Compare
- Still pulls from main by default - Will pull from relevant monorepo branch based on env.BRANCH - That env var is a Netlify convention
7ee6b33
to
ba7d3c5
Compare
- Run inside `extract-monorepo-docs` & `link-monorepo-docs` to grab necessary version numbers
- Add version to all appropriate URLs - Use `pageContext.fullPath` instead of `data.currentPage.fields.slug`, where appropriate - `fullPath` includes version & framework - Use `pageContext.slug` instead of `data.currentPage.fields.slug` everywhere else - Obviates the need for `data.currentPage.fields.slug` entirely - Extract addStateToToc util - Make stories more realistic
- Remove from Header - Fix format in IndexScreen/Hero
ba7d3c5
to
0b54cdb
Compare
|
2f4706d
to
98940aa
Compare
7293e1b
to
338ab13
Compare
e6d5ef8
to
4d2174e
Compare
You can preview the (now working! 🎉 thanks, @winkerVSbecks!) functionality in this deploy preview: Note that only You can also check the "next" redirect: |
435b92e
to
9cb8216
Compare
- Generate structured list of versions - Place on pageContext - Extend `buildPathWithFramework` to use a provided version instead of always using the current version - Refactor FrameworkSelector - To have a similar API - Adjust styles & layout Co-authored-by: domyen <[email protected]>
- Render on docs pages when not viewing latest Co-authored-by: domyen <[email protected]>
- Hide non-latest docs from search engines - Only build sitemap for latest version - Prevent addons pages from being built when not on latest version - Add redirects for versioned URLs - Add redirects from `/docs/next/*` to `/docs/6.4/*` - Where `6.4` is whatever the "next" version is - Move built files to appropriate location when not on latest version - Make AddonsDetailsScreen resilient to bad data - Add more robust error handing to createAddonsPages Co-authored-by: winkerVSbecks <[email protected]>
- Add docs/versioning.md to explain steps and how it works
- On push to master
- Set to release branch URL when not on latest - Update CSP to allow release branch URL origin - Update build & serve commands to enable prefix - Remove `move-built-files` script Co-authored-by: Varun Vachhar <[email protected]>
- Ensure redirects don't include current version - Change "next" redirect to a permanent proxy rewrite
9cb8216
to
f7624e0
Compare
Description
Add versioning to Storybook docs.
latestVersion
Screenshot
How to Test
yarn start
&yarn build
)BRANCH=release-6-0 yarn build
, orBRANCH=release-6-0 yarn extract-monorepo-docs && yarn start
yarn extract-monorepo-docs
andyarn link-monorepo-docs
still work, with their various argumentsTODO
After merging this...
release-6-0
,release-6-1
,release-6-2
,release-6-4
branches to Netlify build settingsAfter merging storybookjs/storybook#16580...