docs: support detecting broken link cross-projects (#10483)

* docs: support detecting broken link cross-projects

* remove double separators
This commit is contained in:
Shahed Nasser
2024-12-06 19:54:46 +02:00
committed by GitHub
parent a76b533604
commit e7e36f39fb
28 changed files with 492 additions and 166 deletions

View File

@@ -832,7 +832,7 @@ If you click on the workflow, you'll view a reference of that workflow, includin
This is useful if you want to extend an API route and pass additional data or perform custom actions.
Refer to [this guide](https://docs.medusajs.com/learn/customization/extend-features/extend-create-product) to find an example of extending an API route.
Refer to [this guide](!docs!/learn/customization/extend-features/extend-create-product) to find an example of extending an API route.
<Feedback
event="survey_api-ref"

View File

@@ -4,7 +4,7 @@ import DownloadFull from "@/components/DownloadFull"
<H3 className="!mt-0">Just Getting Started?</H3>
Check out the [Medusa v2 Documentation](https://docs.medusajs.com).
Check out the [Medusa v2 Documentation](!docs!).
<Space bottom={8} />
@@ -16,7 +16,7 @@ To use Medusa's JS SDK library, install the following packages in your project (
npm install @medusajs/js-sdk@latest @medusajs/types@latest
```
Learn more about the JS SDK in [this documentation](https://docs.medusajs.com/resources/js-sdk).
Learn more about the JS SDK in [this documentation](!resources!/js-sdk).
### Download Full Reference

View File

@@ -831,7 +831,7 @@ If you click on the workflow, you'll view a reference of that workflow, includin
This is useful if you want to extend an API route and pass additional data or perform custom actions.
Refer to [this guide](https://docs.medusajs.com/learn/customization/extend-features/extend-create-product) to find an example of extending an API route.
Refer to [this guide](!docs!/learn/customization/extend-features/extend-create-product) to find an example of extending an API route.
<Feedback
event="survey_api-ref"

View File

@@ -2,6 +2,11 @@ import createMDX from "@next/mdx"
import bundleAnalyzer from "@next/bundle-analyzer"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import rehypeSlug from "rehype-slug"
import {
brokenLinkCheckerPlugin,
crossProjectLinksPlugin,
} from "remark-rehype-plugins"
import path from "path"
/** @type {import('next').NextConfig} */
const nextConfig = {
@@ -28,6 +33,48 @@ const nextConfig = {
const withMDX = createMDX({
options: {
rehypePlugins: [
[
brokenLinkCheckerPlugin,
{
crossProjects: {
docs: {
projectPath: path.resolve("..", "book"),
},
resources: {
projectPath: path.resolve("..", "resources"),
hasGeneratedSlugs: true,
},
ui: {
projectPath: path.resolve("..", "ui"),
contentPath: "src/content/docs",
},
},
},
],
[
crossProjectLinksPlugin,
{
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
projectUrls: {
docs: {
url: process.env.NEXT_PUBLIC_DOCS_URL,
path: "",
},
resources: {
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
},
"user-guide": {
url: process.env.NEXT_PUBLIC_USER_GUIDE_URL,
},
ui: {
url: process.env.NEXT_PUBLIC_UI_URL,
},
},
useBaseUrl:
process.env.NODE_ENV === "production" ||
process.env.VERCEL_ENV === "production",
},
],
[
rehypeMdxCodeProps,
{

View File

@@ -41,6 +41,7 @@
"react-transition-group": "^4.4.5",
"rehype-mdx-code-props": "^3.0.1",
"rehype-slug": "^6.0.0",
"remark-rehype-plugins": "*",
"slugify": "^1.6.6",
"swr": "^2.2.0",
"tailwind": "*",