docusaurus-plugin-openapi-docs 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -27,15 +27,18 @@ function getDocsPluginConfig(presetsPlugins, pluginId) {
27
27
  // eslint-disable-next-line array-callback-return
28
28
  const filteredConfig = presetsPlugins.filter((data) => {
29
29
  // Search presets
30
- if (data[0].endsWith(pluginId)) {
31
- return data[1];
32
- }
33
- // Search plugin-content-docs instances
34
- if (data[0] === "@docusaurus/plugin-content-docs") {
35
- const configPluginId = data[1].id ? data[1].id : "default";
36
- if (configPluginId === pluginId) {
30
+ if (Array.isArray(data)) {
31
+ if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
37
32
  return data[1];
38
33
  }
34
+ // Search plugin-content-docs instances
35
+ if (typeof data[0] === "string" &&
36
+ data[0] === "@docusaurus/plugin-content-docs") {
37
+ const configPluginId = data[1].id ? data[1].id : "default";
38
+ if (configPluginId === pluginId) {
39
+ return data[1];
40
+ }
41
+ }
39
42
  }
40
43
  })[0];
41
44
  if (filteredConfig) {
@@ -117,7 +120,7 @@ function pluginOpenAPIDocs(context, options) {
117
120
  : `---
118
121
  id: {{{id}}}
119
122
  title: "{{{title}}}"
120
- description: "{{{description}}}"
123
+ description: "{{{frontMatter.description}}}"
121
124
  {{^api}}
122
125
  sidebar_label: Introduction
123
126
  {{/api}}
@@ -147,7 +150,7 @@ info_path: {{{infoPath}}}
147
150
  const infoMdTemplate = `---
148
151
  id: {{{id}}}
149
152
  title: "{{{title}}}"
150
- description: "{{{description}}}"
153
+ description: "{{{frontMatter.description}}}"
151
154
  sidebar_label: {{{title}}}
152
155
  hide_title: true
153
156
  custom_edit_url: null
@@ -164,8 +167,8 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
164
167
  `;
165
168
  const tagMdTemplate = `---
166
169
  id: {{{id}}}
167
- title: "{{{description}}}"
168
- description: "{{{description}}}"
170
+ title: "{{{frontMatter.description}}}"
171
+ description: "{{{frontMatter.description}}}"
169
172
  custom_edit_url: null
170
173
  ---
171
174
 
@@ -256,7 +259,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
256
259
  }
257
260
  async function cleanApiDocs(options) {
258
261
  const { outputDir } = options;
259
- const apiDir = path_1.default.join(siteDir, outputDir);
262
+ const apiDir = (0, utils_1.posixPath)(path_1.default.join(siteDir, outputDir));
260
263
  const apiMdxFiles = await (0, utils_1.Globby)(["*.api.mdx", "*.info.mdx", "*.tag.mdx"], {
261
264
  cwd: path_1.default.resolve(apiDir),
262
265
  deep: 1,
@@ -60,7 +60,7 @@ async function createPostmanCollection(openapiData) {
60
60
  return await jsonToCollection(data);
61
61
  }
62
62
  function createItems(openapiData, sidebarOptions) {
63
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
63
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
64
64
  // TODO: Find a better way to handle this
65
65
  let items = [];
66
66
  const infoId = (0, kebabCase_1.default)(openapiData.info.title);
@@ -75,13 +75,20 @@ function createItems(openapiData, sidebarOptions) {
75
75
  var _a;
76
76
  const description = getTagDisplayName(tag.name, (_a = openapiData.tags) !== null && _a !== void 0 ? _a : []);
77
77
  const tagId = (0, kebabCase_1.default)(tag.name);
78
+ const splitDescription = description.match(/[^\r\n]+/g);
78
79
  const tagPage = {
79
80
  type: "tag",
80
81
  id: tagId,
81
82
  unversionedId: tagId,
82
83
  title: description !== null && description !== void 0 ? description : "",
83
84
  description: description !== null && description !== void 0 ? description : "",
84
- frontMatter: {},
85
+ frontMatter: {
86
+ description: splitDescription
87
+ ? splitDescription[0]
88
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
89
+ .replace(/\s+$/, "")
90
+ : "",
91
+ },
85
92
  tag: {
86
93
  ...tag,
87
94
  },
@@ -91,6 +98,11 @@ function createItems(openapiData, sidebarOptions) {
91
98
  }
92
99
  if (openapiData.info.description) {
93
100
  // Only create an info page if we have a description.
101
+ const infoDescription = (_b = openapiData.info) === null || _b === void 0 ? void 0 : _b.description;
102
+ let splitDescription;
103
+ if (infoDescription) {
104
+ splitDescription = infoDescription.match(/[^\r\n]+/g);
105
+ }
94
106
  const infoPage = {
95
107
  type: "info",
96
108
  id: infoId,
@@ -99,12 +111,18 @@ function createItems(openapiData, sidebarOptions) {
99
111
  description: openapiData.info.description
100
112
  ? openapiData.info.description.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
101
113
  : "",
102
- frontMatter: {},
103
- securitySchemes: (_b = openapiData.components) === null || _b === void 0 ? void 0 : _b.securitySchemes,
114
+ frontMatter: {
115
+ description: splitDescription
116
+ ? splitDescription[0]
117
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
118
+ .replace(/\s+$/, "")
119
+ : "",
120
+ },
121
+ securitySchemes: (_c = openapiData.components) === null || _c === void 0 ? void 0 : _c.securitySchemes,
104
122
  info: {
105
123
  ...openapiData.info,
106
124
  tags: openapiData.tags,
107
- title: (_c = openapiData.info.title) !== null && _c !== void 0 ? _c : "Introduction",
125
+ title: (_d = openapiData.info.title) !== null && _d !== void 0 ? _d : "Introduction",
108
126
  logo: openapiData.info["x-logo"],
109
127
  darkLogo: openapiData.info["x-dark-logo"],
110
128
  },
@@ -114,18 +132,18 @@ function createItems(openapiData, sidebarOptions) {
114
132
  for (let [path, pathObject] of Object.entries(openapiData.paths)) {
115
133
  const { $ref, description, parameters, servers, summary, ...rest } = pathObject;
116
134
  for (let [method, operationObject] of Object.entries({ ...rest })) {
117
- const title = (_e = (_d = operationObject.summary) !== null && _d !== void 0 ? _d : operationObject.operationId) !== null && _e !== void 0 ? _e : "Missing summary";
135
+ const title = (_f = (_e = operationObject.summary) !== null && _e !== void 0 ? _e : operationObject.operationId) !== null && _f !== void 0 ? _f : "Missing summary";
118
136
  if (operationObject.description === undefined) {
119
137
  operationObject.description =
120
- (_g = (_f = operationObject.summary) !== null && _f !== void 0 ? _f : operationObject.operationId) !== null && _g !== void 0 ? _g : "";
138
+ (_h = (_g = operationObject.summary) !== null && _g !== void 0 ? _g : operationObject.operationId) !== null && _h !== void 0 ? _h : "";
121
139
  }
122
140
  const baseId = operationObject.operationId
123
141
  ? (0, kebabCase_1.default)(operationObject.operationId)
124
142
  : (0, kebabCase_1.default)(operationObject.summary);
125
- const servers = (_j = (_h = operationObject.servers) !== null && _h !== void 0 ? _h : pathObject.servers) !== null && _j !== void 0 ? _j : openapiData.servers;
126
- const security = (_k = operationObject.security) !== null && _k !== void 0 ? _k : openapiData.security;
143
+ const servers = (_k = (_j = operationObject.servers) !== null && _j !== void 0 ? _j : pathObject.servers) !== null && _k !== void 0 ? _k : openapiData.servers;
144
+ const security = (_l = operationObject.security) !== null && _l !== void 0 ? _l : openapiData.security;
127
145
  // Add security schemes so we know how to handle security.
128
- const securitySchemes = (_l = openapiData.components) === null || _l === void 0 ? void 0 : _l.securitySchemes;
146
+ const securitySchemes = (_m = openapiData.components) === null || _m === void 0 ? void 0 : _m.securitySchemes;
129
147
  // Make sure schemes are lowercase. See: https://github.com/cloud-annotations/docusaurus-plugin-openapi/issues/79
130
148
  if (securitySchemes) {
131
149
  for (let securityScheme of Object.values(securitySchemes)) {
@@ -135,12 +153,12 @@ function createItems(openapiData, sidebarOptions) {
135
153
  }
136
154
  }
137
155
  let jsonRequestBodyExample;
138
- const body = (_o = (_m = operationObject.requestBody) === null || _m === void 0 ? void 0 : _m.content) === null || _o === void 0 ? void 0 : _o["application/json"];
156
+ const body = (_p = (_o = operationObject.requestBody) === null || _o === void 0 ? void 0 : _o.content) === null || _p === void 0 ? void 0 : _p["application/json"];
139
157
  if (body === null || body === void 0 ? void 0 : body.schema) {
140
158
  jsonRequestBodyExample = (0, createRequestExample_1.sampleRequestFromSchema)(body.schema);
141
159
  }
142
160
  // Handle vendor JSON media types
143
- const bodyContent = (_p = operationObject.requestBody) === null || _p === void 0 ? void 0 : _p.content;
161
+ const bodyContent = (_q = operationObject.requestBody) === null || _q === void 0 ? void 0 : _q.content;
144
162
  if (bodyContent) {
145
163
  const firstBodyContentKey = Object.keys(bodyContent)[0];
146
164
  if (firstBodyContentKey.endsWith("+json")) {
@@ -162,6 +180,11 @@ function createItems(openapiData, sidebarOptions) {
162
180
  defaults.parameters = parameters;
163
181
  }
164
182
  }
183
+ const opDescription = operationObject.description;
184
+ let splitDescription;
185
+ if (opDescription) {
186
+ splitDescription = opDescription.match(/[^\r\n]+/g);
187
+ }
165
188
  const apiPage = {
166
189
  type: "api",
167
190
  id: baseId,
@@ -171,7 +194,13 @@ function createItems(openapiData, sidebarOptions) {
171
194
  description: operationObject.description
172
195
  ? operationObject.description.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
173
196
  : "",
174
- frontMatter: {},
197
+ frontMatter: {
198
+ description: splitDescription
199
+ ? splitDescription[0]
200
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
201
+ .replace(/\s+$/, "")
202
+ : "",
203
+ },
175
204
  api: {
176
205
  ...defaults,
177
206
  tags: operationObject.tags,
@@ -222,7 +251,7 @@ async function readOpenapiFiles(openapiPath, options) {
222
251
  const sources = allFiles.filter((x) => !x.includes("_category_")); // todo: regex exclude?
223
252
  return Promise.all(sources.map(async (source) => {
224
253
  // TODO: make a function for this
225
- const fullPath = path_1.default.join(openapiPath, source);
254
+ const fullPath = (0, utils_1.posixPath)(path_1.default.join(openapiPath, source));
226
255
  const data = (await (0, loadAndResolveSpec_1.loadAndResolveSpec)(fullPath));
227
256
  return {
228
257
  source: fullPath,
@@ -10,12 +10,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const path_1 = __importDefault(require("path"));
13
+ const utils_1 = require("@docusaurus/utils");
13
14
  const _1 = require(".");
14
15
  // npx jest packages/docusaurus-plugin-openapi/src/openapi/openapi.test.ts --watch
15
16
  describe("openapi", () => {
16
17
  describe("readOpenapiFiles", () => {
17
18
  it("readOpenapiFiles", async () => {
18
- const results = await (0, _1.readOpenapiFiles)(path_1.default.join(__dirname, "__fixtures__/examples"), { specPath: "./", outputDir: "./" });
19
+ const results = await (0, _1.readOpenapiFiles)((0, utils_1.posixPath)(path_1.default.join(__dirname, "__fixtures__/examples")), { specPath: "./", outputDir: "./" });
19
20
  const categoryMeta = results.find((x) => x.source.endsWith("_category_.json"));
20
21
  expect(categoryMeta).toBeFalsy();
21
22
  // console.log(results);
@@ -10,6 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const path_1 = __importDefault(require("path"));
13
+ const utils_1 = require("@docusaurus/utils");
13
14
  const clsx_1 = __importDefault(require("clsx"));
14
15
  const lodash_1 = require("lodash");
15
16
  const uniq_1 = __importDefault(require("lodash/uniq"));
@@ -74,7 +75,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
74
75
  .map((tag) => {
75
76
  var _a;
76
77
  // Map info object to tag
77
- const taggedInfoObject = intros.find((i) => i.tags ? i.tags.includes(tag) : undefined);
78
+ const taggedInfoObject = intros.find((i) => i.tags ? i.tags.find((t) => t.name === tag) : undefined);
78
79
  const tagObject = tags.flat().find((t) => {
79
80
  var _a;
80
81
  return (_a = tag === t.name) !== null && _a !== void 0 ? _a : {
@@ -106,8 +107,8 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
106
107
  type: "generated-index",
107
108
  title: tag,
108
109
  slug: label
109
- ? path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(label), (0, lodash_1.kebabCase)(tag))
110
- : path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(tag)),
110
+ ? (0, utils_1.posixPath)(path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(label), (0, lodash_1.kebabCase)(tag)))
111
+ : (0, utils_1.posixPath)(path_1.default.join("/category", basePath, (0, lodash_1.kebabCase)(tag))),
111
112
  };
112
113
  }
113
114
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "1.4.1",
4
+ "version": "1.4.3",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -68,5 +68,5 @@
68
68
  "engines": {
69
69
  "node": ">=14"
70
70
  },
71
- "gitHead": "ddfa49093f75f628536b8d9e25f88eb9e541667c"
71
+ "gitHead": "277586102253008f831bedbb990fb9854658a190"
72
72
  }
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ import fs from "fs";
9
9
  import path from "path";
10
10
 
11
11
  import type { LoadContext, Plugin } from "@docusaurus/types";
12
- import { Globby } from "@docusaurus/utils";
12
+ import { Globby, posixPath } from "@docusaurus/utils";
13
13
  import chalk from "chalk";
14
14
  import { render } from "mustache";
15
15
 
@@ -30,18 +30,24 @@ export function getDocsPluginConfig(
30
30
  // eslint-disable-next-line array-callback-return
31
31
  const filteredConfig = presetsPlugins.filter((data) => {
32
32
  // Search presets
33
- if (data[0].endsWith(pluginId)) {
34
- return data[1];
35
- }
36
-
37
- // Search plugin-content-docs instances
38
- if (data[0] === "@docusaurus/plugin-content-docs") {
39
- const configPluginId = data[1].id ? data[1].id : "default";
40
- if (configPluginId === pluginId) {
33
+ if (Array.isArray(data)) {
34
+ if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
41
35
  return data[1];
42
36
  }
37
+
38
+ // Search plugin-content-docs instances
39
+ if (
40
+ typeof data[0] === "string" &&
41
+ data[0] === "@docusaurus/plugin-content-docs"
42
+ ) {
43
+ const configPluginId = data[1].id ? data[1].id : "default";
44
+ if (configPluginId === pluginId) {
45
+ return data[1];
46
+ }
47
+ }
43
48
  }
44
49
  })[0];
50
+
45
51
  if (filteredConfig) {
46
52
  // Search presets, e.g. "classic"
47
53
  if (filteredConfig[0].endsWith(pluginId)) {
@@ -153,7 +159,7 @@ export default function pluginOpenAPIDocs(
153
159
  : `---
154
160
  id: {{{id}}}
155
161
  title: "{{{title}}}"
156
- description: "{{{description}}}"
162
+ description: "{{{frontMatter.description}}}"
157
163
  {{^api}}
158
164
  sidebar_label: Introduction
159
165
  {{/api}}
@@ -184,7 +190,7 @@ info_path: {{{infoPath}}}
184
190
  const infoMdTemplate = `---
185
191
  id: {{{id}}}
186
192
  title: "{{{title}}}"
187
- description: "{{{description}}}"
193
+ description: "{{{frontMatter.description}}}"
188
194
  sidebar_label: {{{title}}}
189
195
  hide_title: true
190
196
  custom_edit_url: null
@@ -202,8 +208,8 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
202
208
 
203
209
  const tagMdTemplate = `---
204
210
  id: {{{id}}}
205
- title: "{{{description}}}"
206
- description: "{{{description}}}"
211
+ title: "{{{frontMatter.description}}}"
212
+ description: "{{{frontMatter.description}}}"
207
213
  custom_edit_url: null
208
214
  ---
209
215
 
@@ -332,7 +338,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
332
338
 
333
339
  async function cleanApiDocs(options: APIOptions) {
334
340
  const { outputDir } = options;
335
- const apiDir = path.join(siteDir, outputDir);
341
+ const apiDir = posixPath(path.join(siteDir, outputDir));
336
342
  const apiMdxFiles = await Globby(["*.api.mdx", "*.info.mdx", "*.tag.mdx"], {
337
343
  cwd: path.resolve(apiDir),
338
344
  deep: 1,
@@ -7,6 +7,8 @@
7
7
 
8
8
  import path from "path";
9
9
 
10
+ import { posixPath } from "@docusaurus/utils";
11
+
10
12
  import { readOpenapiFiles } from ".";
11
13
 
12
14
  // npx jest packages/docusaurus-plugin-openapi/src/openapi/openapi.test.ts --watch
@@ -15,7 +17,7 @@ describe("openapi", () => {
15
17
  describe("readOpenapiFiles", () => {
16
18
  it("readOpenapiFiles", async () => {
17
19
  const results = await readOpenapiFiles(
18
- path.join(__dirname, "__fixtures__/examples"),
20
+ posixPath(path.join(__dirname, "__fixtures__/examples")),
19
21
  { specPath: "./", outputDir: "./" }
20
22
  );
21
23
  const categoryMeta = results.find((x) =>
@@ -7,7 +7,7 @@
7
7
 
8
8
  import path from "path";
9
9
 
10
- import { Globby, GlobExcludeDefault } from "@docusaurus/utils";
10
+ import { Globby, GlobExcludeDefault, posixPath } from "@docusaurus/utils";
11
11
  import Converter from "@paloaltonetworks/openapi-to-postmanv2";
12
12
  import sdk from "@paloaltonetworks/postman-collection";
13
13
  import Collection from "@paloaltonetworks/postman-collection";
@@ -98,13 +98,20 @@ function createItems(
98
98
  openapiData.tags ?? []
99
99
  );
100
100
  const tagId = kebabCase(tag.name);
101
+ const splitDescription = description.match(/[^\r\n]+/g);
101
102
  const tagPage: PartialPage<TagPageMetadata> = {
102
103
  type: "tag",
103
104
  id: tagId,
104
105
  unversionedId: tagId,
105
106
  title: description ?? "",
106
107
  description: description ?? "",
107
- frontMatter: {},
108
+ frontMatter: {
109
+ description: splitDescription
110
+ ? splitDescription[0]
111
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
112
+ .replace(/\s+$/, "")
113
+ : "",
114
+ },
108
115
  tag: {
109
116
  ...tag,
110
117
  },
@@ -115,6 +122,11 @@ function createItems(
115
122
 
116
123
  if (openapiData.info.description) {
117
124
  // Only create an info page if we have a description.
125
+ const infoDescription = openapiData.info?.description;
126
+ let splitDescription: any;
127
+ if (infoDescription) {
128
+ splitDescription = infoDescription.match(/[^\r\n]+/g);
129
+ }
118
130
  const infoPage: PartialPage<InfoPageMetadata> = {
119
131
  type: "info",
120
132
  id: infoId,
@@ -126,7 +138,13 @@ function createItems(
126
138
  "$1'"
127
139
  )
128
140
  : "",
129
- frontMatter: {},
141
+ frontMatter: {
142
+ description: splitDescription
143
+ ? splitDescription[0]
144
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
145
+ .replace(/\s+$/, "")
146
+ : "",
147
+ },
130
148
  securitySchemes: openapiData.components?.securitySchemes,
131
149
  info: {
132
150
  ...openapiData.info,
@@ -208,6 +226,12 @@ function createItems(
208
226
  }
209
227
  }
210
228
 
229
+ const opDescription = operationObject.description;
230
+ let splitDescription: any;
231
+ if (opDescription) {
232
+ splitDescription = opDescription.match(/[^\r\n]+/g);
233
+ }
234
+
211
235
  const apiPage: PartialPage<ApiPageMetadata> = {
212
236
  type: "api",
213
237
  id: baseId,
@@ -220,7 +244,13 @@ function createItems(
220
244
  "$1'"
221
245
  )
222
246
  : "",
223
- frontMatter: {},
247
+ frontMatter: {
248
+ description: splitDescription
249
+ ? splitDescription[0]
250
+ .replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
251
+ .replace(/\s+$/, "")
252
+ : "",
253
+ },
224
254
  api: {
225
255
  ...defaults,
226
256
  tags: operationObject.tags,
@@ -290,7 +320,7 @@ export async function readOpenapiFiles(
290
320
  return Promise.all(
291
321
  sources.map(async (source) => {
292
322
  // TODO: make a function for this
293
- const fullPath = path.join(openapiPath, source);
323
+ const fullPath = posixPath(path.join(openapiPath, source));
294
324
  const data = (await loadAndResolveSpec(
295
325
  fullPath
296
326
  )) as unknown as OpenApiObject;
@@ -13,6 +13,7 @@ import {
13
13
  SidebarItemCategoryLinkConfig,
14
14
  SidebarItemDoc,
15
15
  } from "@docusaurus/plugin-content-docs/src/sidebars/types";
16
+ import { posixPath } from "@docusaurus/utils";
16
17
  import clsx from "clsx";
17
18
  import { kebabCase } from "lodash";
18
19
  import uniq from "lodash/uniq";
@@ -110,7 +111,7 @@ function groupByTags(
110
111
  .map((tag) => {
111
112
  // Map info object to tag
112
113
  const taggedInfoObject = intros.find((i) =>
113
- i.tags ? i.tags.includes(tag) : undefined
114
+ i.tags ? i.tags.find((t: any) => t.name === tag) : undefined
114
115
  );
115
116
  const tagObject = tags.flat().find(
116
117
  (t) =>
@@ -148,8 +149,15 @@ function groupByTags(
148
149
  type: "generated-index" as "generated-index",
149
150
  title: tag,
150
151
  slug: label
151
- ? path.join("/category", basePath, kebabCase(label), kebabCase(tag))
152
- : path.join("/category", basePath, kebabCase(tag)),
152
+ ? posixPath(
153
+ path.join(
154
+ "/category",
155
+ basePath,
156
+ kebabCase(label),
157
+ kebabCase(tag)
158
+ )
159
+ )
160
+ : posixPath(path.join("/category", basePath, kebabCase(tag))),
153
161
  } as SidebarItemCategoryLinkConfig;
154
162
  }
155
163