|
| 1 | +diff --git a/lib/constants.js b/lib/constants.js |
| 2 | +index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75ba14c894 100644 |
| 3 | +--- a/lib/constants.js |
| 4 | ++++ b/lib/constants.js |
| 5 | +@@ -10,8 +10,8 @@ exports.VERSIONS_JSON_FILE = exports.VERSIONED_SIDEBARS_DIR = exports.VERSIONED_ |
| 6 | + /** The name of the version that's actively worked on (e.g. `website/docs`) */ |
| 7 | + exports.CURRENT_VERSION_NAME = 'current'; |
| 8 | + /** All doc versions are stored here by version names */ |
| 9 | +-exports.VERSIONED_DOCS_DIR = 'versioned_docs'; |
| 10 | ++exports.VERSIONED_DOCS_DIR = 'content'; |
| 11 | + /** All doc versioned sidebars are stored here by version names */ |
| 12 | +-exports.VERSIONED_SIDEBARS_DIR = 'versioned_sidebars'; |
| 13 | ++exports.VERSIONED_SIDEBARS_DIR = 'sidebars'; |
| 14 | + /** The version names. Should 1-1 map to the content of versioned docs dir. */ |
| 15 | +-exports.VERSIONS_JSON_FILE = 'versions.json'; |
| 16 | ++exports.VERSIONED_BASE_DIR = 'docs/versioned'; |
| 17 | +diff --git a/lib/versions/files.js b/lib/versions/files.js |
| 18 | +index 5a3efcb0b3dec47120fe32b8824e0c4ca7987df8..5295a02a6fe5829d7621a37a14d456947a75c6de 100644 |
| 19 | +--- a/lib/versions/files.js |
| 20 | ++++ b/lib/versions/files.js |
| 21 | +@@ -13,20 +13,14 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra")); |
| 22 | + const utils_1 = require("@docusaurus/utils"); |
| 23 | + const constants_1 = require("../constants"); |
| 24 | + const validation_1 = require("./validation"); |
| 25 | +-/** Add a prefix like `community_version-1.0.0`. No-op for default instance. */ |
| 26 | +-function addPluginIdPrefix(fileOrDir, pluginId) { |
| 27 | +- return pluginId === utils_1.DEFAULT_PLUGIN_ID |
| 28 | +- ? fileOrDir |
| 29 | +- : `${pluginId}_${fileOrDir}`; |
| 30 | +-} |
| 31 | +-/** `[siteDir]/community_versioned_docs/version-1.0.0` */ |
| 32 | ++/** `[siteDir]/docs/versioned/paper/content/1.0.0` */ |
| 33 | + function getVersionDocsDirPath(siteDir, pluginId, versionName) { |
| 34 | +- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_DOCS_DIR, pluginId), `version-${versionName}`); |
| 35 | ++ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_DOCS_DIR, versionName); |
| 36 | + } |
| 37 | + exports.getVersionDocsDirPath = getVersionDocsDirPath; |
| 38 | +-/** `[siteDir]/community_versioned_sidebars/version-1.0.0-sidebars.json` */ |
| 39 | ++/** `[siteDir]/docs/versioned/paper/sidebars/1.0.0.json` */ |
| 40 | + function getVersionSidebarsPath(siteDir, pluginId, versionName) { |
| 41 | +- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_SIDEBARS_DIR, pluginId), `version-${versionName}-sidebars.json`); |
| 42 | ++ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_SIDEBARS_DIR, `${versionName}.json`); |
| 43 | + } |
| 44 | + exports.getVersionSidebarsPath = getVersionSidebarsPath; |
| 45 | + function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) { |
| 46 | +@@ -43,9 +37,9 @@ function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) { |
| 47 | + }); |
| 48 | + } |
| 49 | + exports.getDocsDirPathLocalized = getDocsDirPathLocalized; |
| 50 | +-/** `community` => `[siteDir]/community_versions.json` */ |
| 51 | ++/** `community` => `[siteDir]/docs/versioned/paper.json` */ |
| 52 | + function getVersionsFilePath(siteDir, pluginId) { |
| 53 | +- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONS_JSON_FILE, pluginId)); |
| 54 | ++ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, `${pluginId}.json`); |
| 55 | + } |
| 56 | + exports.getVersionsFilePath = getVersionsFilePath; |
| 57 | + /** |
0 commit comments