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
11 changes: 0 additions & 11 deletions .github/scripts/set-last-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
16 changes: 12 additions & 4 deletions docs/PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ 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/`
to `main`, and explicitly dispatches `docs-publish.yml` via
`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

Expand Down Expand Up @@ -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://<your-username>.github.io/mellea/`.

## File reference

| Path | Description |
Expand Down
13 changes: 5 additions & 8 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Comment thread
ajbozarth marked this conversation as resolved.
},
},
Expand Down Expand Up @@ -170,6 +167,10 @@ const config: Config = {
position: 'left',
label: 'API Reference',
},
{
type: 'docsVersionDropdown',
position: 'left',
},
{
href: 'https://mellea.ai/blogs/',
label: 'Blog',
Expand All @@ -180,10 +181,6 @@ const config: Config = {
label: 'Community',
position: 'right',
},
{
type: 'docsVersionDropdown',
position: 'right',
},
{
href: 'https://github.com/generative-computing/mellea',
label: 'GitHub',
Expand Down
Loading