Files
medusa-store/www/apps/book/next.config.mjs
Shahed Nasser 728c5ee53c docs: preparations for preview (#7267)
* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content
2024-05-13 11:32:52 +03:00

97 lines
2.4 KiB
JavaScript

import mdx from "@next/mdx"
import rehypeMdxCodeProps from "rehype-mdx-code-props"
import rehypeSlug from "rehype-slug"
import {
brokenLinkCheckerPlugin,
localLinksRehypePlugin,
cloudinaryImgRehypePlugin,
pageNumberRehypePlugin,
crossProjectLinksPlugin,
} from "remark-rehype-plugins"
import { sidebar } from "./sidebar.mjs"
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
rehypePlugins: [
[
crossProjectLinksPlugin,
{
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
projectUrls: {
resources: {
url:
process.env.VERCEL_ENV !== "production"
? process.env.NEXT_PUBLIC_RESOURCES_URL
: undefined,
path: "v2/resources",
},
"user-guide": {
url:
process.env.VERCEL_ENV !== "production"
? process.env.NEXT_PUBLIC_USER_GUIDE_URL
: undefined,
path: "v2/user-guide",
},
ui: {
url:
process.env.VERCEL_ENV !== "production"
? process.env.NEXT_PUBLIC_UI_URL
: undefined,
path: "ui",
},
api: {
url:
process.env.VERCEL_ENV !== "production"
? process.env.NEXT_PUBLIC_API_URL
: undefined,
path: "api",
},
},
},
],
[brokenLinkCheckerPlugin],
[localLinksRehypePlugin],
[
rehypeMdxCodeProps,
{
tagName: "code",
},
],
[rehypeSlug],
[
cloudinaryImgRehypePlugin,
{
cloudinaryConfig: {
cloudName: process.env.CLOUDINARY_CLOUD_NAME || "",
flags: ["fl_lossy", "f_auto"],
resize: {
action: "pad",
aspectRatio: "16:9",
},
roundCorners: 16,
},
},
],
[
pageNumberRehypePlugin,
{
sidebar: sidebar,
},
],
],
jsx: true,
},
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2",
}
export default withMDX(nextConfig)