diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f58996404..d398360bf3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,7 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check - [Reporting Issues](#reporting-issues) - [Pull Request Guidelines](#pull-request-guidelines) - [Deploying](#deploying) + - [Archiving a Version](#archiving-a-version) - [License](#license) --- @@ -175,6 +176,33 @@ When submitting pull requests, please keep the scope of your change contained to The Ionic documentation's `main` branch is deployed automatically and separately from the [Ionic site](https://github.com/ionic-team/ionic-site) itself. The Ionic site then uses a proxy for paths under `/docs` to request the deployed documentation. +### Archiving a Version + +Archived versions are served from a frozen Vercel deployment instead of being rebuilt on every `main` deploy, which keeps build times and memory usage low. Two files control this: + +- [`versions.json`](./versions.json): lists the versions Docusaurus rebuilds on every deploy. +- [`versionsArchived.json`](./versionsArchived.json): maps each archived version to the frozen deployment URL the version picker links to. + +The archived URL has to point at a build that _included_ the version, so you build it first, then move it to `versionsArchived.json`: + +1. **Build the version.** Make sure it is in `versions.json`. If you are refreshing an already-archived version, move it out of `versionsArchived.json` and back into `versions.json`. Commit, push and let Vercel deploy. +2. **Promote the deployment.** In the Vercel dashboard, open that deployment and **Promote to Production** so it does not get cleaned up. Wait for the build to finish before pushing again, or it may get canceled. +3. **Copy its URL.** Use the deployment's unique `ionic-docs--ionic1.vercel.app` URL, not the branch or production alias. +4. **Archive it.** Remove the version from `versions.json`, then add it to `versionsArchived.json` with `/docs/` appended and no trailing slash (a trailing slash causes a brief 404 flash): + + ```json + { + "v6": "https://ionic-docs--ionic1.vercel.app/docs/v6" + } + ``` + +5. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building that version. + +Removed versions keep their `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`. + +> [!NOTE] +> Ionic v3 and v4 use other build tools and are not managed here. + --- ## License diff --git a/versionsArchived.json b/versionsArchived.json index e50b56fb14..1630fc691b 100644 --- a/versionsArchived.json +++ b/versionsArchived.json @@ -1,4 +1,4 @@ { - "v6": "https://ionic-docs-fo03f34h5-ionic1.vercel.app/docs/v6", + "v6": "https://ionic-docs-lq0if04rc-ionic1.vercel.app/docs/v6", "v5": "https://ionic-docs-5utg8ms4c-ionic1.vercel.app/docs/v5" }