Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ The archived URL has to point at a build that _included_ `<archiving>`, so you b

Everything from here on refers to `<archiving>`:

2. **Build `<archiving>`.** 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 `<archiving>`.** 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-<hash>-ionic1.vercel.app` URL, not the branch or production alias.
5. **Archive it.** Remove `<archiving>` from `versions.json`, then add it to `versionsArchived.json` with `/docs/<archiving>` appended and no trailing slash (a trailing slash causes a brief 404 flash):
Expand Down Expand Up @@ -306,9 +306,27 @@ Everything from here on refers to `<archiving>`:
+ choices: ['8', '9'],
```

10. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building `<archiving>`.
10. **Update the generation scripts.** Remove `<archiving>` 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-<archiving>/native/${fileName}`, apiContent);
writeFileSync(`versioned_docs/version-v8/native/${fileName}`, apiContent);
```

_`scripts/cli.mjs`_

```diff
writeFileSync(`docs/${path}`, data);
- writeFileSync(`versioned_docs/version-<archiving>/${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 `<archiving>`.

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.
Expand Down
2 changes: 0 additions & 2 deletions scripts/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 0 additions & 2 deletions scripts/native.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down