-
Notifications
You must be signed in to change notification settings - Fork 241
Add Javascript API versioning #283
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
There's a version of the docs published here: https://mdr-ci.staging.k6.io/docs/refs/pull/283/merge It will be deleted automatically in 30 days. |
@vi-nastya Please, can you rebase I'd like to launch with:
|
@ppcano the |
This PR adds setup for versioning
javascript api
sectionDeployed: https://mdr-ci.staging.k6.io/docs/refs/pull/283/merge/javascript-api/
How it works
Currently we only support versioning for
Javascript API
section of the docs.Files for the latest version are located in
src/data/markdown/docs/02 javascript api
and page URLs have no version prefix.Other versions are located in
src/data/markdown/versioned-js-api
and URLs for versioned pages contain the version number (e.g.https://k6.io/docs/javascript-api/v0-31/
,https://k6.io/docs/javascript-api/v0-31/k6-crypto/createhash-algorithm/
)How to add a new version
Let's say the v0.33 is released and we want to add docs for it and make it the new latest version.
Run
npm run archive-version v0.32
(you might need to runchmode +x ./archive-js-api-version.sh
first)This script will create a new folder inside
src/data/markdown/versioned-js-api
namedv0.32
and copy the content ofsrc/data/markdown/docs/02 javascript api
there.It would also replace internal links in md files for javascript api section to point to v0.32 pages.
If any pages had a custom slug set in the frontmatter, the value would also be updated to include version number
Go to
src/utils/versioning.js
and addv0.32
to SUPPORTED_VERSIONS. SetLATEST_VERSION = v0.33
.Add docs for v0.33 to
src/data/markdown/docs/02 javascript api
Screenshot
