Skip to content

feat: add docsPath config for root-mounted docs#197

Merged
Kinfe123 merged 1 commit into
mainfrom
feat/docs-path-config
May 19, 2026
Merged

feat: add docsPath config for root-mounted docs#197
Kinfe123 merged 1 commit into
mainfrom
feat/docs-path-config

Conversation

@Kinfe123
Copy link
Copy Markdown
Member

@Kinfe123 Kinfe123 commented May 19, 2026

Summary by cubic

Add support for a custom public docs path via a new docsPath config so docs can be served from the site root or a custom prefix without moving source files. All rewrites, .md routes, canonical links, search, redirects, and client navigation use the public path while the internal entry stays unchanged.

  • New Features

    • Added docsPath?: string to DocsConfig; defaults to entry. Set to "" or "/" to mount at root.
    • Next withDocs: reads/normalizes docsPath from docs.config.*; rewrites map the public path (root or prefix) to internal /<entry>, expose /docs.md and /:slug.md, and route Accept/signature-agent requests at the public path. Hidden-folder redirects now point through the public docs path. Agent, sitemap, and robots endpoints remain at the root. @farming-labs/next/mdx-plugins/remark-markdown-alternate accepts docsPath and emits correct alternates (root page → /docs.md, others → /:slug.md).
    • Docs API: reads/normalizes docsPath (from options or docs.config.*), search index and changelog URLs use it, markdown requests resolve through the public path (root or prefix), rendered markdown URLs are rewritten to it, and canonical Link headers reflect it.
    • Layout/Client: nav URL, breadcrumbs, active states, internal links, and client-side routing honor the public path; adds a click guard and link rewriter so navigation works correctly in root-mounted and prefixed modes.
    • Tests: coverage for root-mounted rewrites, hidden-folder redirects via the public path, MDX alternates, and changelog markdown canonical links.
  • Migration

    • To serve docs from the site root, set docsPath: "" (or "/") in docs.config.*; no content moves needed.
    • To use a custom prefix, set docsPath: "/your-prefix".

Written for commit 990c204. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment May 19, 2026 9:49pm

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

@farming-labs/astro

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro@197

@farming-labs/astro-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro-theme@197

@farming-labs/docs

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/docs@197

@farming-labs/theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/theme@197

@farming-labs/next

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/next@197

@farming-labs/nuxt

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt@197

@farming-labs/nuxt-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt-theme@197

@farming-labs/svelte

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte@197

@farming-labs/svelte-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte-theme@197

@farming-labs/tanstack-start

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/tanstack-start@197

commit: 990c204

@Kinfe123 Kinfe123 force-pushed the feat/docs-path-config branch from 45c5b37 to 82edfd5 Compare May 19, 2026 21:31
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/next/src/config.ts Outdated
Comment thread packages/fumadocs/src/docs-api.ts
Comment thread packages/next/src/config.ts
Comment thread packages/fumadocs/src/docs-page-client.tsx
Comment thread packages/fumadocs/src/docs-api.ts
@Kinfe123 Kinfe123 force-pushed the feat/docs-path-config branch from 82edfd5 to 990c204 Compare May 19, 2026 21:43
@Kinfe123 Kinfe123 merged commit 004d352 into main May 19, 2026
8 checks passed
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.

1 participant