feat: add docsPath config for root-mounted docs#197
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
45c5b37 to
82edfd5
Compare
Contributor
There was a problem hiding this comment.
5 issues found across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
82edfd5 to
990c204
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Add support for a custom public docs path via a new
docsPathconfig 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 internalentrystays unchanged.New Features
docsPath?: stringtoDocsConfig; defaults toentry. Set to "" or "/" to mount at root.withDocs: reads/normalizesdocsPathfromdocs.config.*; rewrites map the public path (root or prefix) to internal/<entry>, expose/docs.mdand/: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-alternateacceptsdocsPathand emits correct alternates (root page →/docs.md, others →/:slug.md).docsPath(from options ordocs.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.Migration
docsPath: ""(or "/") indocs.config.*; no content moves needed.docsPath: "/your-prefix".Written for commit 990c204. Summary will update on new commits. Review in cubic