-
Couldn't load subscription status.
- Fork 243
Add version for Javascript API documentation
k6 docs project supports versioning for Javascript API section.
md 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/)
Let's say the v0.33 is released and we want to add docs for it and make it the new latest version.
-
Make sure that
src/data/markdown/docs/02 javascript apicontains thev0.32docs you want to archive. -
Prepare for running
archive-js-api-version.sh
- Add exec permission:
chmod +x ./archive-js-api-version.sh - Make sure you have installed the
archive-js-api-version.shdependencies.
- Run
npm run archive-version v0.32This script will
- create a new folder inside
src/data/markdown/versioned-js-apinamedv0.32 - copy the content of
src/data/markdown/docs/02 javascript apithere. - replace internal links in
mdfiles for javascript api section to point tov0.32pages. - if any Javascript API pages have custom
slugset in thefrontmatter, the value would also be updated to include version number.
-
Go to
src/utils/versioning.jsand addv0.32toSUPPORTED_VERSIONS. SetLATEST_VERSION = v0.33. -
Clean the cache and test it.
gatsby cleannpm start
- Now, you can add the new docs for
v0.33tosrc/data/markdown/docs/02 javascript apior merge open PRs forv0.33.