diff --git a/.github/scripts/set-last-version.mjs b/.github/scripts/set-last-version.mjs index 14acadef8..473fca43f 100644 --- a/.github/scripts/set-last-version.mjs +++ b/.github/scripts/set-last-version.mjs @@ -20,16 +20,5 @@ if (updated === src) { } src = updated; -// Add path: 'main' to the current version block if not already present. -// This is a one-time insertion needed once a snapshot version exists as the -// default — before the first snapshot, current IS the default and needs no path. -if (!src.includes("path: 'main'")) { - src = src.replace( - /label: 'main \(unreleased\)',/, - "label: 'main (unreleased)',\n path: 'main',", - ); - console.log("Added path: 'main' to versions.current"); -} - writeFileSync(configPath, src); console.log(`Set lastVersion to '${version}' in ${configPath}`); diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 4d08580f1..abf9e126e 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -96,8 +96,8 @@ The `docs-publish.yml` workflow (`Docs` in GitHub Actions) runs these steps: Docusaurus versioning is integrated into the release pipeline: -- **Pre-release / dev builds:** the site shows `main (unreleased)` as the - only version — there are no snapshots yet. +- **Pre-release / dev builds:** the site shows `Next` as the only version + — there are no snapshots yet. - **On each final release** (`publish-release.yml` with `bump_type: final` or `patch-final`): the `snapshot-docs` job runs `docusaurus docs:version X.Y.Z`, commits `versioned_docs/version-X.Y.Z/` @@ -105,12 +105,12 @@ Docusaurus versioning is integrated into the release pipeline: `workflow_dispatch`. (A `GITHUB_TOKEN` push cannot trigger a new workflow run, so the dispatch is explicit rather than relying on a path filter.) - **Version dropdown** in the navbar lets users switch between released - versions and `main (unreleased)`. + versions and `Next`. No manual bootstrap is needed — the first final release run triggers `snapshot-docs` automatically, which creates the initial snapshot and updates `lastVersion`. Until the first final release, the site shows only -`main (unreleased)` in the version dropdown, which is correct. +`Next` in the version dropdown, which is correct. ## Local development @@ -166,6 +166,14 @@ To preview the deployed site from a non-main branch: > with a permission error. Push the branch to the upstream repo and use > manual dispatch instead. +### Previewing from your own fork + +To get a live preview site from your fork (useful for reviewing visual changes before submitting a PR): + +1. **Push your branch** to your fork. The `docs-publish.yml` workflow runs automatically and deploys to the `gh-pages` branch on your fork, creating it if it doesn't exist. +2. **Enable GitHub Pages** on your fork: Settings → Pages → Source: `gh-pages` branch, root `/`. +3. Your preview is live at `https://.github.io/mellea/`. + ## File reference | Path | Description | diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index c61d9dfa5..205e9ac9d 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -36,13 +36,10 @@ const config: Config = { showLastUpdateTime: true, editUrl: 'https://github.com/generative-computing/mellea/edit/main/', includeCurrentVersion: true, - // set-last-version.mjs matches these lines with exact regexes — do not reformat + // set-last-version.mjs matches this line with an exact regex — do not reformat lastVersion: 'current', versions: { current: { - label: 'main (unreleased)', - // path is added by the release pipeline (set-last-version.mjs) on - // first final release, once a snapshot version exists as the default banner: 'none', }, }, @@ -170,6 +167,10 @@ const config: Config = { position: 'left', label: 'API Reference', }, + { + type: 'docsVersionDropdown', + position: 'left', + }, { href: 'https://mellea.ai/blogs/', label: 'Blog', @@ -180,10 +181,6 @@ const config: Config = { label: 'Community', position: 'right', }, - { - type: 'docsVersionDropdown', - position: 'right', - }, { href: 'https://github.com/generative-computing/mellea', label: 'GitHub',