Repository navigation
docs: migrate from Mintlify to Docusaurus 3 (issue #62) - #63
Conversation
Replaces the Mintlify documentation setup with a Docusaurus 3.10 site
that builds cleanly and deploys to GitHub Pages via a single CI job.
## What changed
**Scaffold**: package.json, tsconfig.json, docusaurus.config.ts,
sidebars.ts, src/ (theme, components, css, pages), static/ (assets).
**Config**: env-driven baseUrl/url so the same build previews on a fork
(planetf1.github.io/docs/) and deploys on the upstream host.
routeBasePath is set to 'granite/docs' so all existing public URLs
(/granite/docs/...) keep resolving without redirects.
**Components**: MDX shims for Mintlify constructs used in content —
Card, CardGroup (with lucide-react icon rendering), CodeGroup (stacked
shim; tab UX is a follow-up), Accordion/AccordionGroup (details/summary).
**Content sweep** (49 MDX files):
- sidebarTitle → sidebar_label
- icon: frontmatter removed (Mintlify-only)
- <Note>/<Warning> converted to native :::note/:::warning admonitions
- Internal absolute /granite/docs/... links preserved (routeBasePath
matches, .mdx extensions dropped)
- Playground href updated to full external URL
- responsible-ai/index: external-URL-only page replaced with stub +
sidebar link entry pointing to ibm.com/granite/trust
- 7 orphaned pages (not in docs.json nav) marked displayed_sidebar: null
and deferred to a follow-up issue for nav reconnection review
- 2 pre-existing broken links fixed (time-series, docling-rag)
**CI** (.github/workflows/docs-publish.yml): build-and-validate on PRs,
deploy on push to main. Includes markdownlint and codespell (soft gates,
continue-on-error). External link check via lychee on schedule only.
SHA-pinned actions, permissions: {} top-level + least-privilege per job.
Closes #62
Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
Signed-off-by: Nigel Jones <[email protected]>
- checkout: use de0fac2 (v6) matching mellea - setup-node: v4 SHA - upload-artifact: 043fb46 (v7) matching mellea - download-artifact: 3e5f45b (v8) — was pointing at non-existent v4 SHA - Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true env var Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]> Signed-off-by: Nigel Jones <[email protected]>
DOCS_BASE_URL is now derived from github.event.repository.name so that any fork gets the correct /<repo-name>/ prefix automatically, matching the GH Pages URL that GitHub assigns. The upstream ibm-granite/docs continues to use /docs/. Also update docusaurus.config.ts default to /docs/ and make SITE_URL configurable via DOCS_SITE_URL env var. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]> Signed-off-by: Nigel Jones <[email protected]>
- Pin lycheeverse/lychee-action to SHA (v2.8.0) — all other actions were already pinned; lychee was the only floating tag - Add schedule: cron trigger so link-check job actually runs weekly; the condition referenced 'schedule' but the trigger was never defined - Add DOCS_SITE_URL env derived from github.repository_owner so fork previews get the correct canonical URL instead of planetf1.github.io - Drop hardcoded 'https://planetf1.github.io' fallback from config; DOCS_SITE_URL defaults to ibm-granite.github.io - Remove docs.json (Mintlify config — migration parity confirmed) - Remove root fonts/ (duplicate of static/fonts/; Docusaurus only serves from static/) - Remove granite/docs/analytics.js (duplicate of static/analytics.js) - Remove src/components/Note.tsx and Warning.tsx (dead code — content was converted to native :::note/:::warning; neither is registered in MDXComponents.tsx and no MDX uses them) - Fix stale analytics.js header comment referencing Mintlify - Add dev-mode console.warn in Icon for unmapped icon names so conversion gaps are visible during npm start Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
- Set onBrokenLinks/onBrokenAnchors to 'throw' so broken internal links fail CI rather than passing silently - Fix dead links in orphaned pages that were blocking 'throw': granite-code-on-replicate: ./granite-vs-code-extension → ./granite-code-with-continue (the actual VS Code assistant page); models/code: add /granite/docs/ prefix to two internal card hrefs - Remove @docusaurus/faster dependency (package was declared but the future: experimental_faster config key was never set, so it did nothing; remove rather than silently depend on it) - Remove @font-face fallback blocks from custom.css; the absolute /fonts/... paths 404 under the /docs/ baseUrl used on GH Pages staging — Google Fonts @import on line 1 covers both weights already Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
CardGroup was using repeat(N, 1fr) which locked to a fixed column count regardless of screen width. Switch to auto-fit with a 280px minimum so the grid collapses to a single column on mobile, matching what ajbozarth flagged on the equivalent mellea PR. Also remove "Mintlify-compatible" from the README components section — these are Docusaurus components now. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Without explicit styling the active ToC entry is only distinguishable by a faint colour shift, easy to miss on long pages. Add a left border accent + slightly bolder weight to make the current position clear, matching the visual convention Mintlify used. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
…compat
static/fonts/ woff2 files are no longer referenced (font-face blocks were
removed in the prior commit; Google Fonts import covers both weights).
CardGroup cols prop comment clarifies it is accepted for back-compat with
existing MDX that passes cols={2}, but layout is now auto-fit responsive.
Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
Plain <a href="/granite/docs/..."> resolves against the domain root, which breaks on fork GH Pages where baseUrl is /granite-docs/ rather than /. @docusaurus/Link prepends baseUrl for internal paths and passes external URLs through unchanged. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
- Icon.tsx: handle SVG-path icons (href starting with '/') by rendering an <img> instead of silently returning null. Fixes the Colab icon being invisible on all cookbook Cards that use icon="/granite/docs/images/icons8-google-colab.svg". - Card.tsx: increase icon size 16→20px and remove opacity:0.7 so Card icons are visually comparable to the original site. - docusaurus.config.ts: add sidebarCollapsed:false so all sidebar categories default to expanded, matching the original Mintlify behaviour. - src/theme/DocItem/Content: swizzle to render the 'description' frontmatter field as a subtitle paragraph below the page title. Only shown when non-empty, so model pages (description:"") are unaffected. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Sidebar items on both the Docs and Cookbooks tabs now show the same
icons as the original Mintlify site.
Mechanism:
- sidebar_custom_props: {icon: "..."} added to all 47 MDX content files,
restoring the icon values that were stripped during migration. The
icon name lives in the content file — no changes to sidebars.ts
needed for individual pages.
- Ollama category gets customProps: {icon: "download"} directly in
sidebars.ts (the only category-level icon in the original nav).
- New ejected swizzle src/theme/DocSidebarItem/Link reads
item.customProps.icon and renders it inline inside the <Link> element
so it inherits active/hover colour state correctly.
Icon library:
- Migrated Icon component from lucide-react to @fortawesome/react-fontawesome
(free-solid + free-brands). FA Free covers ~90% of the original icon
names directly; the remaining ~10% that are FA Pro-only use the nearest
free equivalent (bee → faBug, hat-chef → faUtensils, sparkles →
faWandMagicSparkles, etc.). shield-check falls back to lucide-react
ShieldCheck (only remaining Lucide dependency).
- Card icons on content pages (github, arrow-right, book, rocket…) now
also render via FA, giving visual consistency across sidebar and cards.
- SVG-path icons (Colab logo) continue to render as <img>.
Also adds a production cutover note to docs-publish.yml documenting
the DOCS_SITE_URL / DOCS_BASE_URL values required for IBM hosting.
Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
Fonts: - Replace Google Fonts CDN import with self-hosted IBM Plex Sans and IBM Plex Mono (OFL-1.1) sourced from the @ibm/plex npm package. Weights: Sans 300/400/500/600/700 + italics; Mono 400/500 + italics. - @font-face declarations are emitted via headTags in docusaurus.config.ts so the path prefix is the resolved BASE_URL, not hard-coded '/'. This ensures fonts load correctly whether the site is at / or a subdirectory (e.g. /docs/ on GitHub Pages). - No external network request needed to render the IBM Plex typeface; eliminates the Google Fonts dependency for privacy/GDPR compliance. SEO: - Add page-specific description frontmatter to all 8 model pages that previously had empty descriptions. Each description is derived from the page's own Overview section and is accurate to the content. Pages now get distinct og:description and <meta name="description"> values instead of falling back to the site-level generic string. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Two classes of broken asset references, both caused by Mintlify-era absolute paths that don't account for Docusaurus baseUrl: 1. Colab SVG icon (18 Card occurrences + 1 sidebar_custom_props): icon="/granite/docs/images/icons8-google-colab.svg" → icon="images/icons8-google-colab.svg" Icon component now calls useBaseUrl() for any non-FA/Lucide path, so the correct baseUrl prefix (/docs/ on GH Pages, / in production) is applied at runtime. 2. LM Studio step screenshots (5 <img> tags): src="/granite/docs/images/lmstudio/..." (absolute, not processed) →  (markdown syntax, webpack-processed) Webpack now content-hashes the PNGs and rewrites the src correctly. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
The previous wrapper approach injected the description before OriginalDocItemContent, which put it above the H1. Ejected the component properly so the description paragraph is inserted between the synthetic title and MDXContent, matching the original site order: Title (H1) → Description subtitle → Page body Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Sidebar nav items inherited the 16px body font size and 400 weight, making them visually heavier than the original site. - All .menu__link: 0.875rem (14px), weight 400 - Category headings (.menu__link--sublist): weight 600 (bold), matching Mintlify's bold section labels (Introduction, Models, etc.) Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
- Remove editUrl: no "Edit this page" link on public site; all changes go through CI not direct GitHub edits. - showLastUpdateAuthor: false: don't surface individual contributor names; CI bot would show as author in production anyway. - showLastUpdateTime kept: "Last updated on <date>" is useful context. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
showLastUpdateTime: false — the date sat between page content and the prev/next paginator, which looked odd. On a public CI-deployed site it adds little value; the git history is the authoritative source. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
- --ifm-font-size-base: 15px (down from 16px): IBM Plex Sans renders slightly larger than the system fonts Mintlify defaults to; 15px aligns the visual weight more closely. - .markdown max-width: 680px: Mintlify maple constrains prose content to ~680px via Tailwind prose; Docusaurus fills a wider column (~770px with TOC). This is the main reason the new site feels larger. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Constraining .markdown to 680px wastes horizontal space on wide screens and breaks code blocks. Let Docusaurus manage column widths. Keep the 15px base font-size reduction from the previous commit. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Docusaurus default --ifm-h1-font-size is 2rem (32px). Mintlify maple page titles are ~1.75rem (28px). Body text was already the same (16px) in both platforms. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
- --ifm-h2-font-size: 1.375rem (22px, down from 1.5rem/24px) - --ifm-heading-font-weight: 600 (semibold, down from 700/bold) IBM Plex Sans Bold is heavier than Mintlify's semibold headings. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
Infima defaults navbar links to #1c1e21 (dark grey). Mintlify uses pure black. Also add font-weight:500 to match Mintlify's slightly heavier navbar link weight. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
The three Ollama OS variants (Mac/Linux/Windows) clutter the sidebar when expanded. collapsed: true overrides the global sidebarCollapsed: false for this category only. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
|
I've made some updates to look more similar to the old site. I've left the new right doc nav in place. Fonts and font sizes should be closer now as is iconography. Things like search bar placement have been left as docusaurus defaults. Please review. thanks I suggest this site is published no later than Wed 10th, so having all reviews submitted by Mon 11th (allowing a day for updates) would be preferable. With agreement we can go sooner. |
|
Looks great! I have some comments. Haven't gotten a chance to dig deeper and provide solutions, just capturing for now.
Note The footer link comments below should account for the analytics parameters. I am suggesting the plain links.
|
- granite.mdx: fix missing small.png via webpack import (same root
cause as LM Studio images — JSX <img src> is not webpack-processed;
import + {smallPng} reference resolves it correctly).
- Footer Ollama link: granite4 → granite4.1
- Footer Blog link: ibm.com/blog → research.ibm.com/blog?tag=artificial-intelligence
- Footer link hover: override to white — dark footer + black primary
hover color made links unreadable on hover.
Assisted-by: Claude Code
Signed-off-by: Nigel Jones <[email protected]>
|
Thanks @serjikibm — fixes in c3ac206:
On the console errors: these are preview-only artefacts.
Fixed in 01d0ad9: analytics now only loads on |
The script was running on the GitHub Pages preview, which caused two console errors (sandboxed iframe, consent-before-tags) and sent noise to IBM analytics with a preview siteId. Both errors are from ibm-common.js and only surface outside IBM's production web stack, which provides the consent platform and correct CSP headers. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
serjikibm
left a comment
There was a problem hiding this comment.
LGTM... thanks for making the changes.
ajbozarth
left a comment
There was a problem hiding this comment.
LGTM — this delivers what issue #62 asked for: a clean platform swap that preserves URL structure, ports content faithfully, and lands well ahead of the 2026-06-13 license deadline.
I checked out the branch locally and verified:
npm run buildis clean againstonBrokenLinks: 'throw'/onBrokenAnchors: 'throw'/onDuplicateRoutes: 'throw'— the strongest available signal for a migration of this shape- All 49 MDX files migrated mechanically: no
<Note>/<Warning>/<Tip>survive, no top-levelicon:/url:/sidebarTitle:frontmatter, no.mdxextensions in internal links - All 8 orphan pages suppressed via
displayed_sidebar: nullas advertised - All sidebar entries resolve to existing files
routeBasePath: 'granite/docs'preserves all inbound URLs without a redirect map — the #1 SEO/inbound-link risk in a platform swap, killed cleanly- Env-driven
DOCS_BASE_URLmakes fork previews "just work" with no per-fork config edits - CI workflow has the right shape: SHA-pinned actions,
permissions: {}top-level,concurrencywithcancel-in-progress, build artifact handed to deploy job (so deploy can't drift from what was validated), production cutover env vars documented inline - Self-hosted IBM Plex via
@ibm/plexremoves the Google Fonts CDN dependency
Inline comments below are all optional follow-ups — none should block merge. The two I'd most encourage acting on before publish are the markdownlint / codespell CI no-op and tightening the lychee excludes.
One pre-existing nit not introduced by this PR but worth noting for a later sweep: granite/docs/use-cases/multimodal-rag.mdx:26 hard-codes https://www.ibm.com/granite/docs/models/granite/ (with trailing slash). Under trailingSlash: false this only works via a server-side redirect at the production host. An internal absolute link would be more robust.
Architectural note worth surfacing: @docusaurus/plugin-content-docs runs single-instance with two named sidebars rather than two plugin instances. Simpler config, but means the two tabs can't be independently versioned. Fine for now (PR description explains why versioning is deferred); flagging in case Cookbooks ever wants its own lifecycle.
Cutover hand-off looks ready: the env-var delta for IBM web infra is already documented in .github/workflows/docs-publish.yml:7-13.
Add the production URL and explain that every merge to main deploys automatically — no staging, no versioning. Describes final state. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
|
PR has two approvals and is otherwise ready. We're holding the merge pending confirmation from IBM web-infra on how No further review needed at this point. |
Use destination_dir: granite/docs in the gh-pages deploy so the build
lands at /{repo-name}/granite/docs/ on GitHub Pages for any repo name —
no rename required. Combined with routeBasePath: '/' and
DOCS_BASE_URL=/{repo-name}/granite/docs/, every asset (JS, CSS, fonts,
images) is served from under the same granite/docs/ path the Akamai
proxy rule already covers.
Akamai ask: update /granite/docs/* target from Mintlify to
ibm-granite.github.io/docs/granite/docs — same rule type, new origin.
Remove /mintlify-assets/* rule. No new rules, no path rewriting.
Also strips the now-redundant /granite/docs/ prefix from internal MDX
links and JSX href attributes (routeBasePath is '/' so paths are
relative to baseUrl directly).
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The staging fork (planetf1/granite-docs) also needs DOCS_BASE_URL=/granite/docs/ so that asset paths in the built HTML match /granite/docs/assets/... and are covered by the single /granite/docs/* proxy rule. Without this, assets would be prefixed with /granite-docs/granite/docs/ and fail to load through the proxy. Also fixes local dev default BASE_URL and README local dev URL. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Matches the licensing pattern used across all other ibm-granite repos: - LICENSE: stock Apache 2.0 text (identical to granite-io, granite-common, etc.) - package.json: "license": "Apache-2.0" field - SPDX-License-Identifier: Apache-2.0 header on all TypeScript, TSX, and CSS source files; no headers on MDX documentation files (consistent with model repos which carry no per-file headers in markdown content) - proxy-*.mjs local test utilities added to .gitignore Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Drop || true from markdownlint and codespell so issues surface as step annotations; continue-on-error: true still prevents build blocking - Remove redundant package-lock.json from codespell --skip (*.json covers it) - Add comment on plugin-client-redirects explaining it is pre-wired empty for post-cutover redirect entries Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… migration) The page was present in the original Mintlify docs.json navigation but was incorrectly given displayed_sidebar: null during migration. Remove the suppression and add it to the Responsible AI sidebar section. The remaining 6 suppressed pages were genuinely absent from the Mintlify nav and are tracked for content review in #66. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The planetf1/granite-docs hardcode in the DOCS_BASE_URL condition was added temporarily to validate the Akamai staging path (#63). That staging target is confirmed working, so the special case is no longer needed and actively breaks GitHub Pages previews on that fork — assets 404 because the base URL doesn't match the /repo-name/ path GitHub Pages serves forks at. Restores two-tier behaviour: - ibm-granite/docs → /granite/docs/ (IBM.com public path, proxied by Akamai) - any fork → /{repo-name}/granite/docs/ (GitHub Pages preview path) Also adds a repository layout reference to README and tightens up the contributing guide with optional frontmatter fields and the CodeGroup component. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>






This PR migrates the IBM Granite docs site from the Mintlify hosted platform to
Docusaurus 3 + GitHub Pages, resolving issue #62. The existing public URL
structure (`/granite/docs/...`) is preserved exactly via `routeBasePath:
'granite/docs'`, so all inbound links and SEO continue to resolve without any
redirects. Content is ported faithfully — the intent is a clean platform swap,
not a content rewrite.
What changed
Scaffold and config
`docusaurus.config.ts`, `sidebars.ts`. Single `@docusaurus/plugin-content-docs`
instance with two named sidebars (`docsSidebar`, `cookbooksSidebar`) matching
the two tabs in `docs.json`.
`github.event.repository.name` so any fork gets the correct GH Pages prefix
automatically; no config changes needed when reviewing via a fork.
`CodeGroup` (stacked shim). Registered via `src/theme/MDXComponents.tsx`.
`icon:`/`url:` frontmatter keys removed, ``/`` converted to
native `:::note`/`:::warning`, internal links rewritten to absolute
`/granite/docs/...` (drop `.mdx` extension). All content changes are mechanical
platform-compatibility edits — no prose was changed.
codespell on every PR; lychee external link check on schedule/dispatch;
deploy to `gh-pages` on push to `main`. SHA-pinned actions, `permissions: {}`
top-level. Production cutover env vars documented in workflow comments.
Visual and UX customisations (Docusaurus defaults → Granite)
The goal is to match the look and feel of the Mintlify site as closely as
practical without over-constraining the Docusaurus theme. Each deviation from
the Docusaurus default is listed with its reason, so the same decisions can be
evaluated independently if this approach is adopted for other projects (e.g. mellea).
Typography
Navbar
Fonts (self-hosted)
The original Mintlify site self-hosted IBM Plex Sans and IBM Plex Mono. The
initial Docusaurus scaffold loaded them from Google Fonts CDN. This PR restores
self-hosting using `@ibm/plex` (npm, OFL-1.1):
`@font-face` declarations are injected via `headTags` in `docusaurus.config.ts`
using `BASE_URL` as a prefix, so font paths resolve correctly at any deploy
subdirectory (e.g. `/docs/` on GitHub Pages, `/` in production). Eliminates the
Google Fonts CDN dependency for privacy/GDPR compliance.
Sidebar icons
Mintlify renders the `icon:` frontmatter field as a small icon next to each
sidebar item. Docusaurus has no native equivalent; this is implemented via:
(icon names from the original `icon:` frontmatter). The icon lives in the
content file — `sidebars.ts` needs no changes for individual pages.
the `` element so it inherits active/hover colour state correctly.
`customProps: {icon: 'download'}` directly in `sidebars.ts`.
Icon library
The original `docs.json` specifies `"icons": {"library": "lucide"}` but many icon
names are Font Awesome style names that Mintlify silently remaps. The Icon
component uses Font Awesome Free (solid + brands) as the primary library:
equivalent (`faBug`, `faUtensils`, `faWandMagicSparkles`)
`
The same Icon component is used for both sidebar icons and Card content icons,
giving visual consistency across the site.
Content rendering
frontmatter field as a subtitle paragraph between the H1 and the page body
(matching Mintlify's subtitle display). Empty descriptions are skipped.
direct GitHub edits.
both false. The date sat between content and prev/next navigation, which looked
odd; the git history is the authoritative source for content freshness.
SEO
All 8 model pages previously had `description: ""`. Each now has a
content-derived description that appears in ``,
`og:description`, and as the subtitle paragraph below the page title.
Docs versioning
Reviewers familiar with `generative-computing/mellea#1174` may notice that
versioning was not included. That is intentional. Mellea's versioning is tied to
its Python package release pipeline. Granite-docs has no equivalent lifecycle:
model launches add new pages rather than replacing existing ones. Every merge to
`main` updates the live site directly. Versioning can be added non-destructively
later if needed.
Where this fits
Issue #62 — platform migration only. Production cutover (repointing
`ibm.com/granite/docs` away from Mintlify) is an IBM web-infra action outside
this repo, to be coordinated separately after this lands.
Deliberately out of scope (follow-up issues to open)
currently shimmed as stacked display. Converting requires per-file MDX surgery
and risks regressions in a migration PR.
with `displayed_sidebar: null`. Need content review before reconnecting.
Pages. Add `static/CNAME` once the target host is known. See workflow comments
for the required `DOCS_SITE_URL` / `DOCS_BASE_URL` env vars.
headings with icons would need `DocSidebarItem/Category` swizzled separately.
2025-12-03. Safe to delete.
Testing
— build fails on any broken internal link or anchor).
categories. Sidebar icons render. Cards render with icons. CardGroups grid.
Accordions expand. Note/Warning admonitions styled. Dark mode toggle. Search.
Playground external link. Download Granite navbar button.
Closes #62