chore: reorganize docs apps (#7228)
* reorganize docs apps * add README * fix directory * add condition for old docs
This commit is contained in:
1 parent
224ebb2154
commit
4fe28f5a95
6187 files changed
+601447
-598226
No files matched your search
@@ -0,0 +1,57 @@
|
||||
import mdx from "@next/mdx"
|
||||
import {
|
||||
brokenLinkCheckerPlugin,
|
||||
localLinksRehypePlugin,
|
||||
typeListLinkFixerPlugin,
|
||||
} from "remark-rehype-plugins"
|
||||
import { slugChanges } from "./generated/slug-changes.mjs"
|
||||
import mdxPluginOptions from "./mdx-options.mjs"
|
||||
|
||||
const withMDX = mdx({
|
||||
extension: /\.mdx?$/,
|
||||
options: {
|
||||
rehypePlugins: [
|
||||
...mdxPluginOptions.options.rehypePlugins,
|
||||
[brokenLinkCheckerPlugin],
|
||||
[localLinksRehypePlugin],
|
||||
[typeListLinkFixerPlugin],
|
||||
],
|
||||
remarkPlugins: mdxPluginOptions.options.remarkPlugins,
|
||||
jsx: true,
|
||||
},
|
||||
})
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Configure `pageExtensions` to include MDX files
|
||||
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
|
||||
|
||||
transpilePackages: ["docs-ui"],
|
||||
|
||||
// TODO uncomment if we decide on baes path
|
||||
// basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/resources",
|
||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources",
|
||||
async rewrites() {
|
||||
return {
|
||||
fallback: [
|
||||
{
|
||||
source: "/:path*",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
|
||||
}/:path*`,
|
||||
basePath: false,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
async redirects() {
|
||||
// redirect original file paths to the rewrite
|
||||
return slugChanges.map((item) => ({
|
||||
source: item.origSlug,
|
||||
destination: item.newSlug,
|
||||
permanent: true,
|
||||
}))
|
||||
},
|
||||
}
|
||||
|
||||
export default withMDX(nextConfig)
|
||||
Reference in new issue
Block a user