1
+ diff --git a/lib/client/docsSearch.js b/lib/client/docsSearch.js
2
+ index fb1fb547238f704c3f27b4cc40af1e55766702df..2543ba879f86fa967b123b8ba55deb8186ac7fc9 100755
3
+ --- a/lib/client/docsSearch.js
4
+ +++ b/lib/client/docsSearch.js
5
+ @@ -35,5 +35,5 @@ export function useDocsContextualSearchTags() {
6
+ const version = activeVersion ?? preferredVersion ?? latestVersion;
7
+ return getDocsVersionSearchTag(pluginId, version.name);
8
+ }
9
+ - return [...Object.keys(allDocsData).map(getDocPluginTags)];
10
+ + return [...(activePluginAndVersion ? [activePluginAndVersion.activePlugin.pluginId] : Object.keys(allDocsData)).map(getDocPluginTags)];
11
+ }
1
12
diff --git a/lib/constants.js b/lib/constants.js
2
13
index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75ba14c894 100755
3
14
--- a/lib/constants.js
@@ -15,10 +26,10 @@ index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75
15
26
- exports.VERSIONS_JSON_FILE = 'versions.json';
16
27
+ exports.VERSIONED_BASE_DIR = 'docs/versioned';
17
28
diff --git a/lib/versions/files.js b/lib/versions/files.js
18
- index deaadb4357a348c8071b70d72a3c6d9e4e61459f..33f7604f2b93d579169681504b3656453c633fec 100755
29
+ index f63cbb295242437ca8b417d3c32e228e370944e9..396b08c66bec0e4b8b455d32171196fcdd71aa1f 100755
19
30
--- a/lib/versions/files.js
20
31
+++ b/lib/versions/files.js
21
- @@ -13,20 +13,20 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
32
+ @@ -19,19 +19,19 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
22
33
const utils_1 = require("@docusaurus/utils");
23
34
const constants_1 = require("../constants");
24
35
const validation_1 = require("./validation");
@@ -36,24 +47,23 @@ index deaadb4357a348c8071b70d72a3c6d9e4e61459f..33f7604f2b93d579169681504b365645
36
47
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_DOCS_DIR, pluginId), `version-${versionName}`);
37
48
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_DOCS_DIR, versionName); // Paper
38
49
}
39
- exports.getVersionDocsDirPath = getVersionDocsDirPath;
40
50
- /** `[siteDir]/community_versioned_sidebars/version-1.0.0-sidebars.json` */
41
51
+ /** `[siteDir]/docs/versioned/paper/sidebars/1.0.0.json` */ // Paper
42
52
function getVersionSidebarsPath(siteDir, pluginId, versionName) {
43
53
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_SIDEBARS_DIR, pluginId), `version-${versionName}-sidebars.json`);
44
54
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_SIDEBARS_DIR, `${versionName}.json`);
45
55
}
46
- exports.getVersionSidebarsPath = getVersionSidebarsPath;
47
56
function getDocsDirPathLocalized({ localizationDir, pluginId, versionName, }) {
48
- @@ -42,9 +42,9 @@ function getDocsDirPathLocalized({ localizationDir, pluginId, versionName, }) {
57
+ return (0, utils_1.getPluginI18nPath)({
58
+ @@ -45,9 +45,9 @@ function getDocsDirPathLocalized({ localizationDir, pluginId, versionName, }) {
59
+ ],
49
60
});
50
61
}
51
- exports.getDocsDirPathLocalized = getDocsDirPathLocalized;
52
62
- /** `community` => `[siteDir]/community_versions.json` */
53
63
+ /** `community` => `[siteDir]/docs/versioned/paper.json` */ // Paper
54
64
function getVersionsFilePath(siteDir, pluginId) {
55
65
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONS_JSON_FILE, pluginId));
56
66
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, `${pluginId}.json`);
57
67
}
58
- exports.getVersionsFilePath = getVersionsFilePath;
59
68
/**
69
+ * Reads the plugin's respective `versions.json` file, and returns its content.
0 commit comments