docusaurus-plugin-openapi-docs 0.0.0-393 → 0.0.0-394
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/sidebars/index.js +5 -3
- package/package.json +2 -2
- package/src/sidebars/index.ts +7 -4
package/lib/sidebars/index.js
CHANGED
|
@@ -60,7 +60,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
60
60
|
const id = infoItem.id;
|
|
61
61
|
rootIntroDoc = {
|
|
62
62
|
type: "doc",
|
|
63
|
-
id: `${basePath}/${id}`,
|
|
63
|
+
id: basePath === "" || undefined ? `${id}` : `${basePath}/${id}`,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
const tagged = apiTags
|
|
@@ -79,7 +79,9 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
79
79
|
if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
|
|
80
80
|
linkConfig = {
|
|
81
81
|
type: "doc",
|
|
82
|
-
id:
|
|
82
|
+
id: basePath === "" || undefined
|
|
83
|
+
? `${taggedInfoObject.id}`
|
|
84
|
+
: `${basePath}/${taggedInfoObject.id}`,
|
|
83
85
|
};
|
|
84
86
|
}
|
|
85
87
|
// TODO: perhaps move this into a getLinkConfig() function
|
|
@@ -87,7 +89,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
87
89
|
const tagId = (0, lodash_1.kebabCase)(tagObject.name);
|
|
88
90
|
linkConfig = {
|
|
89
91
|
type: "doc",
|
|
90
|
-
id: `${basePath}/${tagId}`,
|
|
92
|
+
id: basePath === "" || undefined ? `${tagId}` : `${basePath}/${tagId}`,
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
95
|
// Default behavior
|
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": "0.0.0-
|
|
4
|
+
"version": "0.0.0-394",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=14"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "0644b9a5a16ee0066910a424a0ad293c070eeee0"
|
|
71
71
|
}
|
package/src/sidebars/index.ts
CHANGED
|
@@ -67,7 +67,6 @@ function groupByTags(
|
|
|
67
67
|
const basePath = docPath
|
|
68
68
|
? outputDir.split(docPath!)[1].replace(/^\/+/g, "")
|
|
69
69
|
: outputDir.slice(outputDir.indexOf("/", 1)).replace(/^\/+/g, "");
|
|
70
|
-
|
|
71
70
|
function createDocItem(item: ApiPageMetadata): SidebarItemDoc {
|
|
72
71
|
const sidebar_label = item.frontMatter.sidebar_label;
|
|
73
72
|
const title = item.title;
|
|
@@ -94,7 +93,7 @@ function groupByTags(
|
|
|
94
93
|
const id = infoItem.id;
|
|
95
94
|
rootIntroDoc = {
|
|
96
95
|
type: "doc" as const,
|
|
97
|
-
id: `${basePath}/${id}`,
|
|
96
|
+
id: basePath === "" || undefined ? `${id}` : `${basePath}/${id}`,
|
|
98
97
|
};
|
|
99
98
|
}
|
|
100
99
|
|
|
@@ -117,7 +116,10 @@ function groupByTags(
|
|
|
117
116
|
if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
|
|
118
117
|
linkConfig = {
|
|
119
118
|
type: "doc",
|
|
120
|
-
id:
|
|
119
|
+
id:
|
|
120
|
+
basePath === "" || undefined
|
|
121
|
+
? `${taggedInfoObject.id}`
|
|
122
|
+
: `${basePath}/${taggedInfoObject.id}`,
|
|
121
123
|
} as SidebarItemCategoryLinkConfig;
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -126,7 +128,8 @@ function groupByTags(
|
|
|
126
128
|
const tagId = kebabCase(tagObject.name);
|
|
127
129
|
linkConfig = {
|
|
128
130
|
type: "doc",
|
|
129
|
-
id:
|
|
131
|
+
id:
|
|
132
|
+
basePath === "" || undefined ? `${tagId}` : `${basePath}/${tagId}`,
|
|
130
133
|
} as SidebarItemCategoryLinkConfig;
|
|
131
134
|
}
|
|
132
135
|
|