docs: support detecting broken link cross-projects (#10483)
* docs: support detecting broken link cross-projects * remove double separators
This commit is contained in:
@@ -11,7 +11,7 @@ export const metadata = {
|
||||
The Medusa Admin has two types of forms:
|
||||
|
||||
1. Create forms, created using the [FocusModal UI component](!ui!/components/focus-modal).
|
||||
2. Edit or update forms, created using the [Drawer UI component](!ui!/ui/components/drawer).
|
||||
2. Edit or update forms, created using the [Drawer UI component](!ui!/components/drawer).
|
||||
|
||||
This guide explains how to create these two form types following the Medusa Admin's conventions.
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ remoteLink.create({
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
Learn more about the remote link in [this documentation](!docs!/advanced-development/module-links/remote-link).
|
||||
Learn more about the remote link in [this documentation](!docs!/learn/advanced-development/module-links/remote-link).
|
||||
|
||||
</Note>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ In this document, you'll learn how to calculate a product variant's price with t
|
||||
|
||||
You'll need the following resources for the taxes calculation:
|
||||
|
||||
1. [Query](!docs!/advanced-development/module-links/query) to retrieve the product's variants' prices for a context. Learn more about that in [this guide](../price/page.mdx).
|
||||
1. [Query](!docs!/learn/advanced-development/module-links/query) to retrieve the product's variants' prices for a context. Learn more about that in [this guide](../price/page.mdx).
|
||||
2. The Tax Module's main service to get the tax lines for each product.
|
||||
|
||||
```ts
|
||||
|
||||
@@ -121,7 +121,7 @@ To do that, you'll consume the [promotionsCreated](/references/medusa-workflows/
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
Learn more about workflow hooks in [this guide](!docs!/advanced-development/workflows/workflow-hooks).
|
||||
Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks).
|
||||
|
||||
</Note>
|
||||
|
||||
@@ -156,7 +156,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
Learn more about additional data validation in [this guide](!docs!/advanced-development/api-routes/additional-data).
|
||||
Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data).
|
||||
|
||||
</Note>
|
||||
|
||||
@@ -208,7 +208,7 @@ In the compensation function that undoes the step's actions in case of an error,
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
Learn more about compensation functions in [this guide](!docs!/advanced-development/workflows/compensation-function).
|
||||
Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function).
|
||||
|
||||
</Note>
|
||||
|
||||
@@ -266,9 +266,9 @@ The workflow accepts as an input the created promotion and the `additional_data`
|
||||
|
||||
In the workflow, you:
|
||||
|
||||
1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows).
|
||||
1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows).
|
||||
2. Create the `Custom` record using the `createCustomStep`.
|
||||
3. Use the `when-then` utility to link the promotion to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows).
|
||||
3. Use the `when-then` utility to link the promotion to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows).
|
||||
|
||||
You'll next execute the workflow in the hook handler.
|
||||
|
||||
@@ -379,7 +379,7 @@ Among the returned `promotion` object, you'll find a `custom` property which hol
|
||||
|
||||
### Retrieve using Query
|
||||
|
||||
You can also retrieve the `Custom` record linked to a promotion in your code using [Query](!docs!/advanced-development/module-links/query).
|
||||
You can also retrieve the `Custom` record linked to a promotion in your code using [Query](!docs!/learn/advanced-development/module-links/query).
|
||||
|
||||
For example:
|
||||
|
||||
@@ -393,7 +393,7 @@ const { data: [promotion] } = await query.graph({
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about how to use Query in [this guide](!docs!/advanced-development/module-links/query).
|
||||
Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -736,7 +736,7 @@ The Medusa Admin plugin can be extended to add widgets, new pages, and setting p
|
||||
icon: AcademicCapSolid,
|
||||
},
|
||||
{
|
||||
href: "!docs!/learn/advanced-development/admin/setting-pages",
|
||||
href: "!docs!/learn/advanced-development/admin/ui-routes#create-settings-page",
|
||||
title: "Create Admin Setting Page",
|
||||
text: "Learn how to add new page to the Medusa Admin settings.",
|
||||
icon: AcademicCapSolid,
|
||||
|
||||
@@ -2008,7 +2008,7 @@ This loops over the returned subscriptions and executes the `createSubscriptionO
|
||||
|
||||
### Further Reads
|
||||
|
||||
- [How to Create a Scheduled Job](!docs!/learn/basics/scheeduled-jobs)
|
||||
- [How to Create a Scheduled Job](!docs!/learn/basics/scheduled-jobs)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -9118,9 +9118,6 @@ export const generatedSidebar = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "separator"
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
|
||||
@@ -7,13 +7,27 @@ import {
|
||||
workflowDiagramLinkFixerPlugin,
|
||||
} from "remark-rehype-plugins"
|
||||
import mdxPluginOptions from "./mdx-options.mjs"
|
||||
import path from "node:path"
|
||||
|
||||
const withMDX = mdx({
|
||||
extension: /\.mdx?$/,
|
||||
options: {
|
||||
rehypePlugins: [
|
||||
[
|
||||
brokenLinkCheckerPlugin,
|
||||
{
|
||||
crossProjects: {
|
||||
docs: {
|
||||
projectPath: path.resolve("..", "book"),
|
||||
},
|
||||
ui: {
|
||||
projectPath: path.resolve("..", "ui"),
|
||||
contentPath: "src/content/docs",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
...mdxPluginOptions.options.rehypePlugins,
|
||||
[brokenLinkCheckerPlugin],
|
||||
[localLinksRehypePlugin],
|
||||
[typeListLinkFixerPlugin],
|
||||
[
|
||||
|
||||
@@ -2131,9 +2131,6 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
title: "General",
|
||||
|
||||
@@ -7,7 +7,7 @@ const monoRepoPath = path.resolve("..", "..", "..")
|
||||
/**
|
||||
*
|
||||
* @param {string} dir - The directory to search in
|
||||
* @returns {Promise<{ origSlug: string; newSlug: string }[]>}
|
||||
* @returns {Promise<import("types").SlugChange[]>}
|
||||
*/
|
||||
export default async function getSlugs(options = {}) {
|
||||
let { dir, basePath = path.resolve("app"), baseSlug = basePath } = options
|
||||
@@ -15,7 +15,7 @@ export default async function getSlugs(options = {}) {
|
||||
dir = basePath
|
||||
}
|
||||
/**
|
||||
* @type {{ origSlug: string; newSlug: string }[]}
|
||||
* @type {import("types").SlugChange[]}
|
||||
*/
|
||||
const slugs = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user