diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e5d0bcc60..63686fc33d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -245,7 +245,7 @@ The archived URL has to point at a build that _included_ ``, so you b Everything from here on refers to ``: -2. **Build ``.** 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. **Build ``.** 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`, and add it back to the generation scripts in step 10. Commit, push and let Vercel deploy. 3. **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. 4. **Copy its URL.** Use the deployment's unique `ionic-docs--ionic1.vercel.app` URL, not the branch or production alias. 5. **Archive it.** Remove `` from `versions.json`, then add it to `versionsArchived.json` with `/docs/` appended and no trailing slash (a trailing slash causes a brief 404 flash): @@ -306,9 +306,27 @@ Everything from here on refers to ``: + choices: ['8', '9'], ``` -10. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building ``. +10. **Update the generation scripts.** Remove `` from the write lists in [`scripts/native.mjs`](./scripts/native.mjs) and [`scripts/cli.mjs`](./scripts/cli.mjs), so every build stops regenerating content for a version served from a frozen deployment. The remaining targets are `docs/` (the current version) and the one older version still in `versions.json`. -Removed versions keep their `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`. + _`scripts/native.mjs`_ + + ```diff + writeFileSync(`docs/native/${fileName}`, apiContent); + - writeFileSync(`versioned_docs/version-/native/${fileName}`, apiContent); + writeFileSync(`versioned_docs/version-v8/native/${fileName}`, apiContent); + ``` + + _`scripts/cli.mjs`_ + + ```diff + writeFileSync(`docs/${path}`, data); + - writeFileSync(`versioned_docs/version-/${path}`, data); + writeFileSync(`versioned_docs/version-v8/${path}`, data); + ``` + +11. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building ``. + +Removed versions keep their authored `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`. Their `native/` and `cli/commands/` pages are generated rather than committed, so a rebuild also needs the version back in the write lists from step 10. Without it those sections build empty. > [!NOTE] > Ionic v3 and v4 use other build tools and are not managed here. diff --git a/scripts/cli.mjs b/scripts/cli.mjs index 7dc4bd3f17..eeb01a3395 100644 --- a/scripts/cli.mjs +++ b/scripts/cli.mjs @@ -30,8 +30,6 @@ function writePage(page) { const path = `cli/commands/${commandToKebab(page.name)}.md`; writeFileSync(`docs/${path}`, data); - writeFileSync(`versioned_docs/version-v6/${path}`, data); - writeFileSync(`versioned_docs/version-v7/${path}`, data); writeFileSync(`versioned_docs/version-v8/${path}`, data); } diff --git a/scripts/native.mjs b/scripts/native.mjs index 748970eb71..dc20bda955 100644 --- a/scripts/native.mjs +++ b/scripts/native.mjs @@ -36,8 +36,6 @@ async function buildPluginApiDocs(pluginId) { const fileName = `${pluginId}.md`; writeFileSync(`docs/native/${fileName}`, apiContent); - writeFileSync(`versioned_docs/version-v6/native/${fileName}`, apiContent); - writeFileSync(`versioned_docs/version-v7/native/${fileName}`, apiContent); writeFileSync(`versioned_docs/version-v8/native/${fileName}`, apiContent); }