docs: support generating sidebar items with tags (#10672)

* docs: support generating sidebar items with tags

* small fix

* fix dependencies

* test

* test fix

* test fix

* test fix

* test fix

* another fix

* revert change

* fix for resources
This commit is contained in:
Shahed Nasser
2024-12-19 18:24:36 +02:00
committed by GitHub
parent 1118e35924
commit 65007c49f6
19 changed files with 119 additions and 54 deletions
+1
View File
@@ -0,0 +1 @@
../../utils
+6
View File
@@ -167,6 +167,12 @@ const nextConfig = {
}
},
redirects,
experimental: {
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},
},
optimizePackageImports: ["@medusajs/icons", "@medusajs/ui"],
}
export default withMDX(nextConfig)
+6 -10
View File
@@ -126,16 +126,12 @@ const nextConfig = {
},
]
},
// Redirects shouldn't be necessary anymore since we have remark / rehype
// plugins that fix links. But leaving this here in case we need it again.
// async redirects() {
// // redirect original file paths to the rewrite
// return slugChanges.map((item) => ({
// source: item.origSlug,
// destination: item.newSlug,
// permanent: true,
// }))
// },
experimental: {
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},
},
optimizePackageImports: ["@medusajs/icons", "@medusajs/ui"],
}
const withBundleAnalyzer = bundleAnalyzer({
+1 -1
View File
@@ -6,11 +6,11 @@ import { sidebar } from "../sidebar.mjs"
import path from "path"
async function main() {
await generateTags(path.resolve("..", "..", "packages", "tags"))
await generateSidebar(sidebar)
await generateSlugChanges()
await generateFilesMap()
await generateEditedDates()
await generateTags(path.resolve("..", "..", "packages", "tags"))
}
void main()
+1 -1
View File
@@ -1,6 +1,6 @@
import { statSync, readdirSync } from "fs"
import path from "path"
import { getFileSlug } from "../../../packages/docs-utils/dist"
import { getFileSlug } from "docs-utils"
const monoRepoPath = path.resolve("..", "..", "..")