Skip to content

Commit

Permalink
refactor(docs): simplify versioning (#3880)
Browse files Browse the repository at this point in the history
* refactor(docs): simplify versioning

* fix redirects
  • Loading branch information
julienrbrt authored Jan 15, 2024
1 parent 3565187 commit 1db7d59
Show file tree
Hide file tree
Showing 424 changed files with 41 additions and 18,296 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/gen-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@ jobs:
run: yarn install
working-directory: ./docs

- name: Generate docusaurus docs for ${{ github.ref_name }}
run: yarn run docusaurus docs:version ${{ github.ref_name }}
- name: Generate docusaurus docs for major version
run: |
VERSION=${{ github.ref_name }}
if [[ $VERSION == v0* ]]; then
# If version starts with v0, use the patch version
DOCUSAURUS_VERSION=${VERSION:1}
else
# Otherwise, use the major version
MAJOR_VERSION=${VERSION%%.*}
DOCUSAURUS_VERSION=${MAJOR_VERSION:1}
fi
yarn run docusaurus docs:version $DOCUSAURUS_VERSION
working-directory: ./docs

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: 'chore: docusaurus deploy version ${{ github.ref_name }}'
commit-message: 'chore(docs): deploy version ${{ github.ref_name }}'
body: ''
title: "chore: docusaurus deploy version ${{ github.ref_name }}"
commit-message: "chore(docs): deploy version ${{ github.ref_name }}"
body: ""
base: main
branch: chore/docs/new-version
add-paths: |
Expand Down
22 changes: 21 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const config = {
({
image: "img/og-image.jpg",
announcementBar: {
content: '<a target="_blank" rel="noopener noreferrer" href="https://ignite.com">← Back to Ignite</a>',
content:
'<a target="_blank" rel="noopener noreferrer" href="https://ignite.com">← Back to Ignite</a>',
isCloseable: false,
},
docs: {
Expand Down Expand Up @@ -243,6 +244,25 @@ const config = {
*/
return [existingPath.replace("/welcome", "/guide")];
}

// The following is done for backwards compatibility
// with the previous path structure of the versioned docs.
if (existingPath.includes("/v28")) {
return [existingPath.replace("/v28", "/v28.0.0")];
}

if (existingPath.includes("/v0.27")) {
return [existingPath.replace("/v0.27", "/v0.27.2")];
}

if (existingPath.includes("/v0.26")) {
return [existingPath.replace("/v0.26", "/v0.26.1")];
}

if (existingPath.includes("/v0.25")) {
return [existingPath.replace("/v0.25", "/v0.25.2")];
}

return; // No redirect created if it doesn't contain /guide
},
},
Expand Down
File renamed without changes.
File renamed without changes.
114 changes: 0 additions & 114 deletions docs/versioned_docs/version-v0.27.1/01-welcome/02-install.md

This file was deleted.

Loading

0 comments on commit 1db7d59

Please sign in to comment.