Skip to content

Split versioned docs from the main site - #314

Draft
thatbudakguy wants to merge 5 commits into
mainfrom
split-versioned-docs-from-site
Draft

Split versioned docs from the main site#314
thatbudakguy wants to merge 5 commits into
mainfrom
split-versioned-docs-from-site

Conversation

@thatbudakguy

Copy link
Copy Markdown
Member

Summary

Fixes #302 without splitting the docs into a separate repo/site.

PR #294 added mike for versioned docs, but since there was only one mkdocs.yml/docs_dir/nav, mike ended up versioning the entire site — blog, about page, showcase, etc. — not just the technical documentation. Every version directory on gh-pages (4.x/, 5.x/) duplicated the whole site, and because CI only auto-deployed on push to main, keeping old version branches' unversioned content in sync required manually checking out e.g. 4.x and running mike deploy by hand. This is visible in git history: showcase/index.md/community.md drifted between main and 4.x, and a blog post had to be cherry-picked onto both branches to appear on both.

This PR keeps everything in this one repository by splitting the single MkDocs config into three files and giving the two "sites" disjoint content directories and deploy targets on gh-pages:

  • mkdocs-base.yml (new) — shared theme/markdown config, inherited via MkDocs's INHERIT key.
  • mkdocs.yml (rewritten) — the unversioned main site (Home, About, Community, Showcase, Blog, and a new Release Calendar nav item), built from docs/. Deployed straight to the root of gh-pages.
  • mkdocs-docs.yml (new) — the versioned technical documentation, built from a new top-level documentation/ folder (moved out of the old docs/docs/). Deployed by mike under a /docs/ prefix (via mike's deploy_prefix setting), so each GeoBlacklight version gets its own copy of just the docs — not the whole site.

docs/docs/releases.md ("Release Calendar", a cross-version GBL v3–v6 compatibility matrix) moved to the unversioned site as a top-level nav item, since it isn't specific to one version.

CI (.github/workflows/ci.yml) now:

  • Runs mike deploy --config-file mkdocs-docs.yml on every push to main or any *.x branch, automating what was previously a manual per-branch step.
  • Builds and deploys the main site to the gh-pages root only on main, via peaceiris/actions-gh-pages with keep_files: true so it never disturbs the docs/ directory mike manages (or CNAME, or the legacy 4.x//5.x/ directories from before this change, which are left as stale-but-harmless).

Not included in this PR (follow-ups)

  • Backporting to origin/4.x: GitHub Actions runs the workflow file as committed on the ref being pushed, so the new "deploy on push to a version branch" trigger won't do anything for 4.x until this same restructuring (new configs + documentation/ layout) is also committed onto that branch. Planned as a small follow-up PR targeting 4.x after this merges.
  • One-time mike set-default --config-file mkdocs-docs.yml --push latest: creates the /docs/ landing-page redirect. Plain mike deploy doesn't create this on its own, so it needs to be run once by hand after the first real deploy from this PR.
  • Cleaning up the stale 4.x/, 5.x/, root versions.json/latest/index.html already on gh-pages from before this change — left alone; they'll go stale but won't 404.

Test plan

  • mkdocs build --config-file mkdocs.yml --strict and mkdocs build --config-file mkdocs-docs.yml --strict both build cleanly.
  • Confirmed the moved metadata.md's read_csv table (via table-reader) still renders after the path fix.
  • Ran a real, no-push mike deploy in a scratch clone and confirmed deploy_prefix: docs produces gh-pages:/docs/5.x/, /docs/latest, /docs/versions.json while leaving the existing root versions.json/index.html/4.x//5.x/ untouched.
  • After merge: watch the Action run once, then confirm https://geoblacklight.org/ and https://geoblacklight.org/docs/latest/ both resolve, and the version-switcher dropdown lists 5.x/4.x and switches correctly.
  • Run the one-time mike set-default command noted above.
  • Open the 4.x backport PR.

🤖 Generated with Claude Code

thatbudakguy and others added 2 commits August 26, 2026 16:36
Splits the single mkdocs.yml/docs_dir into a shared mkdocs-base.yml
plus two leaf configs: mkdocs.yml builds the unversioned main site
(home/about/community/showcase/blog/release calendar) and
mkdocs-docs.yml builds the versioned technical documentation from a
new top-level documentation/ folder, published under a /docs/ prefix
via mike's deploy_prefix so it no longer duplicates the whole site
per version. CI now deploys the main site straight to the gh-pages
root (without disturbing mike's prefix) and auto-runs mike deploy for
any push to main or a version branch (e.g. 4.x), removing the manual
per-branch redeploy step.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@karenmajewicz

Copy link
Copy Markdown
Collaborator

Tested this locally - I can run both the main site and the docs site separately. I don't see a link from the main site to the docs site, though. Is it supposed to show up in the nav?

thatbudakguy and others added 3 commits August 27, 2026 08:55
Splitting the docs into a separate mkdocs build removed the
"Documentation" nav item without replacing it, leaving the main site
with no way to reach the docs. Link to the published /docs/latest/
path instead, since it's now a separate build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a README section explaining the two independent mkdocs serve
commands needed now that the site is two separate configs, and calls
out that the main site's "Documentation" nav link points to the
published production URL rather than a local docs preview, since the
two builds are only combined at deploy time via mike's deploy_prefix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
theme.logo/favicon, extra_css, and the local extra_javascript entry
in mkdocs-base.yml are resolved relative to each config's own
docs_dir, which mkdocs-docs.yml never accounted for when it moved to
docs_dir: documentation. The referenced files (gbl-favicon.png under
images/, stylesheets/extra.css, javascripts/tablesort.js) only
existed under docs/, so the docs build silently fell back to
Material's defaults instead of erroring.

Point theme.logo/favicon at the existing documentation/img/ copy of
the favicon (MkDocs deep-merges INHERIT'd dicts, so this only
overrides those two keys and keeps the rest of theme: from the base
config), and copy extra.css/tablesort.js into documentation/ so the
inherited extra_css/extra_javascript paths resolve the same way they
do for the main site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@thatbudakguy
thatbudakguy marked this pull request as draft August 31, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split documentation from main site

2 participants