@docusaurus/plugin-content-docs 2.0.0-beta.12faed89d → 2.0.0-beta.13

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.
Files changed (138) hide show
  1. package/lib/.tsbuildinfo +1 -1
  2. package/lib/categoryGeneratedIndex.d.ts +12 -0
  3. package/lib/categoryGeneratedIndex.js +37 -0
  4. package/lib/cli.d.ts +2 -2
  5. package/lib/cli.js +12 -34
  6. package/lib/client/docsClientUtils.d.ts +0 -3
  7. package/lib/client/docsClientUtils.js +19 -22
  8. package/lib/docFrontMatter.d.ts +1 -1
  9. package/lib/docFrontMatter.js +7 -3
  10. package/lib/docs.d.ts +25 -3
  11. package/lib/docs.js +125 -41
  12. package/lib/globalData.d.ts +1 -1
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.js +100 -131
  15. package/lib/lastUpdate.js +8 -9
  16. package/lib/markdown/index.d.ts +3 -6
  17. package/lib/markdown/index.js +3 -3
  18. package/lib/markdown/linkify.js +2 -2
  19. package/lib/numberPrefix.d.ts +1 -1
  20. package/lib/options.d.ts +3 -3
  21. package/lib/options.js +48 -11
  22. package/lib/props.d.ts +7 -2
  23. package/lib/props.js +60 -8
  24. package/lib/routes.d.ts +27 -0
  25. package/lib/routes.js +105 -0
  26. package/lib/{sidebarItemsGenerator.d.ts → sidebars/generator.d.ts} +5 -2
  27. package/lib/sidebars/generator.js +216 -0
  28. package/lib/sidebars/index.d.ts +15 -0
  29. package/lib/sidebars/index.js +73 -0
  30. package/lib/sidebars/normalization.d.ts +14 -0
  31. package/lib/sidebars/normalization.js +77 -0
  32. package/lib/sidebars/processor.d.ts +18 -0
  33. package/lib/sidebars/processor.js +85 -0
  34. package/lib/sidebars/types.d.ts +127 -0
  35. package/lib/sidebars/types.js +8 -0
  36. package/lib/sidebars/utils.d.ts +35 -0
  37. package/lib/sidebars/utils.js +228 -0
  38. package/lib/sidebars/validation.d.ts +10 -0
  39. package/lib/sidebars/validation.js +138 -0
  40. package/lib/slug.d.ts +4 -3
  41. package/lib/slug.js +27 -15
  42. package/lib/tags.d.ts +8 -0
  43. package/lib/tags.js +20 -0
  44. package/lib/theme/hooks/useDocs.js +21 -21
  45. package/lib/translations.d.ts +2 -2
  46. package/lib/translations.js +71 -29
  47. package/lib/types.d.ts +52 -63
  48. package/lib/versions.d.ts +3 -3
  49. package/lib/versions.js +41 -22
  50. package/package.json +20 -20
  51. package/src/__tests__/__fixtures__/simple-site/docs/_partials/somePartial.md +3 -0
  52. package/src/__tests__/__fixtures__/simple-site/docs/_partials/subfolder/somePartial.md +3 -0
  53. package/src/__tests__/__fixtures__/simple-site/docs/_somePartial.md +3 -0
  54. package/src/__tests__/__fixtures__/simple-site/docs/foo/baz.md +5 -0
  55. package/src/__tests__/__fixtures__/simple-site/docs/hello.md +2 -0
  56. package/src/__tests__/__fixtures__/simple-site/docs/rootAbsoluteSlug.md +2 -0
  57. package/src/__tests__/__fixtures__/simple-site/docs/rootRelativeSlug.md +2 -0
  58. package/src/__tests__/__fixtures__/simple-site/docs/rootResolvedSlug.md +2 -0
  59. package/src/__tests__/__fixtures__/simple-site/docs/rootTryToEscapeSlug.md +2 -0
  60. package/src/__tests__/__fixtures__/simple-site/sidebars.json +15 -1
  61. package/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-1.md +1 -0
  62. package/src/__tests__/__fixtures__/versioned-site/docs/foo/bar.md +6 -0
  63. package/src/__tests__/__fixtures__/versioned-site/docs/hello.md +3 -0
  64. package/src/__tests__/__fixtures__/versioned-site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  65. package/src/__tests__/__fixtures__/versioned-site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  66. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/hello.md +3 -0
  67. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/somePartial.md +3 -0
  68. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/subfolder/somePartial.md +3 -0
  69. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_somePartial.md +3 -0
  70. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/hello.md +3 -0
  71. package/src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.1-sidebars.json +2 -2
  72. package/src/__tests__/__snapshots__/cli.test.ts.snap +48 -73
  73. package/src/__tests__/__snapshots__/docs.test.ts.snap +140 -0
  74. package/src/__tests__/__snapshots__/index.test.ts.snap +745 -97
  75. package/src/__tests__/__snapshots__/translations.test.ts.snap +45 -15
  76. package/src/__tests__/cli.test.ts +15 -11
  77. package/src/__tests__/docFrontMatter.test.ts +160 -45
  78. package/src/__tests__/docs.test.ts +311 -150
  79. package/src/__tests__/index.test.ts +108 -66
  80. package/src/__tests__/lastUpdate.test.ts +1 -1
  81. package/src/__tests__/options.test.ts +48 -3
  82. package/src/__tests__/props.test.ts +62 -0
  83. package/src/__tests__/slug.test.ts +127 -20
  84. package/src/__tests__/translations.test.ts +7 -1
  85. package/src/__tests__/versions.test.ts +73 -70
  86. package/src/categoryGeneratedIndex.ts +57 -0
  87. package/src/cli.ts +8 -41
  88. package/src/client/docsClientUtils.ts +14 -26
  89. package/{types.d.ts → src/deps.d.ts} +0 -0
  90. package/src/docFrontMatter.ts +9 -4
  91. package/src/docs.ts +158 -32
  92. package/src/globalData.ts +6 -1
  93. package/src/index.ts +125 -169
  94. package/src/lastUpdate.ts +10 -13
  95. package/src/markdown/index.ts +8 -12
  96. package/src/numberPrefix.ts +5 -3
  97. package/src/options.ts +59 -14
  98. package/src/plugin-content-docs.d.ts +173 -40
  99. package/src/props.ts +90 -15
  100. package/src/routes.ts +173 -0
  101. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-shorthand.js +0 -0
  102. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-items.json +0 -0
  103. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-label.json +0 -0
  104. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category.js +0 -0
  105. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed-first-level.json +0 -0
  106. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed.json +0 -0
  107. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-doc-id-not-string.json +0 -0
  108. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-first-level-not-category.js +0 -0
  109. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-href.json +0 -0
  110. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-label.json +0 -0
  111. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link.json +0 -0
  112. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-unknown-type.json +0 -0
  113. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-wrong-field.json +0 -0
  114. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars.json +0 -0
  115. package/src/{__tests__/__snapshots__/sidebars.test.ts.snap → sidebars/__tests__/__snapshots__/index.test.ts.snap} +36 -6
  116. package/src/{__tests__/sidebarItemsGenerator.test.ts → sidebars/__tests__/generator.test.ts} +143 -18
  117. package/src/sidebars/__tests__/index.test.ts +204 -0
  118. package/src/sidebars/__tests__/processor.test.ts +237 -0
  119. package/src/sidebars/__tests__/utils.test.ts +695 -0
  120. package/src/sidebars/__tests__/validation.test.ts +105 -0
  121. package/src/sidebars/generator.ts +310 -0
  122. package/src/sidebars/index.ts +94 -0
  123. package/src/sidebars/normalization.ts +112 -0
  124. package/src/sidebars/processor.ts +154 -0
  125. package/src/sidebars/types.ts +211 -0
  126. package/src/sidebars/utils.ts +329 -0
  127. package/src/sidebars/validation.ts +168 -0
  128. package/src/slug.ts +32 -17
  129. package/src/tags.ts +19 -0
  130. package/src/translations.ts +103 -47
  131. package/src/types.ts +64 -107
  132. package/src/versions.ts +59 -25
  133. package/lib/sidebarItemsGenerator.js +0 -211
  134. package/lib/sidebars.d.ts +0 -43
  135. package/lib/sidebars.js +0 -320
  136. package/src/__tests__/sidebars.test.ts +0 -639
  137. package/src/sidebarItemsGenerator.ts +0 -307
  138. package/src/sidebars.ts +0 -522
package/lib/versions.js CHANGED
@@ -8,16 +8,15 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.getDocsDirPaths = exports.readVersionsMetadata = exports.getVersionsFilePath = exports.getVersionedSidebarsDirPath = exports.getVersionedDocsDirPath = void 0;
10
10
  const tslib_1 = require("tslib");
11
- const path_1 = tslib_1.__importDefault(require("path"));
12
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
11
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
12
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
13
13
  const constants_1 = require("./constants");
14
- const constants_2 = require("@docusaurus/core/lib/constants");
15
14
  const utils_1 = require("@docusaurus/utils");
16
15
  const lodash_1 = require("lodash");
17
16
  const sidebars_1 = require("./sidebars");
18
17
  // retro-compatibility: no prefix for the default plugin id
19
18
  function addPluginIdPrefix(fileOrDir, pluginId) {
20
- if (pluginId === constants_2.DEFAULT_PLUGIN_ID) {
19
+ if (pluginId === utils_1.DEFAULT_PLUGIN_ID) {
21
20
  return fileOrDir;
22
21
  }
23
22
  else {
@@ -83,7 +82,7 @@ function readVersionNames(siteDir, options) {
83
82
  return versions;
84
83
  }
85
84
  function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) {
86
- return utils_1.getPluginI18nPath({
85
+ return (0, utils_1.getPluginI18nPath)({
87
86
  siteDir,
88
87
  locale,
89
88
  pluginName: 'docusaurus-plugin-content-docs',
@@ -108,7 +107,7 @@ function getVersionMetadataPaths({ versionName, context, options, }) {
108
107
  });
109
108
  function getSidebarFilePath() {
110
109
  if (isCurrentVersion) {
111
- return sidebars_1.resolveSidebarPathOption(context.siteDir, options.sidebarPath);
110
+ return (0, sidebars_1.resolveSidebarPathOption)(context.siteDir, options.sidebarPath);
112
111
  }
113
112
  else {
114
113
  return path_1.default.join(getVersionedSidebarsDirPath(context.siteDir, options.id), `version-${versionName}-sidebars.json`);
@@ -138,10 +137,10 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
138
137
  pluginId: id,
139
138
  })
140
139
  : contentPathLocalized;
141
- const versionPathSegment = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
142
- const versionPathSegmentLocalized = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
143
- const versionEditUrl = utils_1.normalizeUrl([editUrl, versionPathSegment]);
144
- const versionEditUrlLocalized = utils_1.normalizeUrl([
140
+ const versionPathSegment = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
141
+ const versionPathSegmentLocalized = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
142
+ const versionEditUrl = (0, utils_1.normalizeUrl)([editUrl, versionPathSegment]);
143
+ const versionEditUrlLocalized = (0, utils_1.normalizeUrl)([
145
144
  editUrl,
146
145
  versionPathSegmentLocalized,
147
146
  ]);
@@ -153,7 +152,7 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
153
152
  function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }) {
154
153
  // Current version: good, no banner
155
154
  if (versionName === lastVersionName) {
156
- return 'none';
155
+ return null;
157
156
  }
158
157
  // Upcoming versions: unreleased banner
159
158
  else if (versionNames.indexOf(versionName) < versionNames.indexOf(lastVersionName)) {
@@ -166,20 +165,34 @@ function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }
166
165
  }
167
166
  function getVersionBanner({ versionName, versionNames, lastVersionName, options, }) {
168
167
  var _a;
169
- const versionOptionBanner = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.banner;
170
- return (versionOptionBanner !== null && versionOptionBanner !== void 0 ? versionOptionBanner : getDefaultVersionBanner({
168
+ const versionBannerOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.banner;
169
+ if (versionBannerOption) {
170
+ return versionBannerOption === 'none' ? null : versionBannerOption;
171
+ }
172
+ return getDefaultVersionBanner({
171
173
  versionName,
172
174
  versionNames,
173
175
  lastVersionName,
174
- }));
176
+ });
177
+ }
178
+ function getVersionBadge({ versionName, versionNames, options, }) {
179
+ var _a;
180
+ const versionBadgeOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.badge;
181
+ // If site is not versioned or only one version is included
182
+ // we don't show the version badge by default
183
+ // See https://github.com/facebook/docusaurus/issues/3362
184
+ const versionBadgeDefault = versionNames.length !== 1;
185
+ return versionBadgeOption !== null && versionBadgeOption !== void 0 ? versionBadgeOption : versionBadgeDefault;
186
+ }
187
+ function getVersionClassName({ versionName, options, }) {
188
+ var _a;
189
+ const versionClassNameOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.className;
190
+ const versionClassNameDefault = `docs-version-${versionName}`;
191
+ return versionClassNameOption !== null && versionClassNameOption !== void 0 ? versionClassNameOption : versionClassNameDefault;
175
192
  }
176
193
  function createVersionMetadata({ versionName, versionNames, lastVersionName, context, options, }) {
177
194
  var _a, _b, _c;
178
- const { sidebarFilePath, contentPath, contentPathLocalized, } = getVersionMetadataPaths({
179
- versionName,
180
- context,
181
- options,
182
- });
195
+ const { sidebarFilePath, contentPath, contentPathLocalized } = getVersionMetadataPaths({ versionName, context, options });
183
196
  const isLast = versionName === lastVersionName;
184
197
  // retro-compatible values
185
198
  const defaultVersionLabel = versionName === constants_1.CURRENT_VERSION_NAME ? 'Next' : versionName;
@@ -193,7 +206,7 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
193
206
  const versionOptions = (_a = options.versions[versionName]) !== null && _a !== void 0 ? _a : {};
194
207
  const versionLabel = (_b = versionOptions.label) !== null && _b !== void 0 ? _b : defaultVersionLabel;
195
208
  const versionPathPart = (_c = versionOptions.path) !== null && _c !== void 0 ? _c : defaultVersionPathPart;
196
- const versionPath = utils_1.normalizeUrl([
209
+ const versionPath = (0, utils_1.normalizeUrl)([
197
210
  context.baseUrl,
198
211
  options.routeBasePath,
199
212
  versionPathPart,
@@ -206,10 +219,14 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
206
219
  });
207
220
  // Because /docs/:route` should always be after `/docs/versionName/:route`.
208
221
  const routePriority = versionPathPart === '' ? -1 : undefined;
222
+ // the path that will be used to refer the docs tags
223
+ // example below will be using /docs/tags
224
+ const tagsPath = (0, utils_1.normalizeUrl)([versionPath, options.tagsBasePath]);
209
225
  return {
210
226
  versionName,
211
227
  versionLabel,
212
228
  versionPath,
229
+ tagsPath,
213
230
  versionEditUrl: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrl,
214
231
  versionEditUrlLocalized: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrlLocalized,
215
232
  versionBanner: getVersionBanner({
@@ -218,6 +235,8 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
218
235
  lastVersionName,
219
236
  options,
220
237
  }),
238
+ versionBadge: getVersionBadge({ versionName, versionNames, options }),
239
+ versionClassName: getVersionClassName({ versionName, options }),
221
240
  isLast,
222
241
  routePriority,
223
242
  sidebarFilePath,
@@ -263,7 +282,7 @@ function checkVersionsOptions(availableVersionNames, options) {
263
282
  !availableVersionNames.includes(options.lastVersion)) {
264
283
  throw new Error(`Docs option lastVersion=${options.lastVersion} is invalid. ${availableVersionNamesMsg}`);
265
284
  }
266
- const unknownVersionConfigNames = lodash_1.difference(Object.keys(options.versions), availableVersionNames);
285
+ const unknownVersionConfigNames = (0, lodash_1.difference)(Object.keys(options.versions), availableVersionNames);
267
286
  if (unknownVersionConfigNames.length > 0) {
268
287
  throw new Error(`Invalid docs option "versions": unknown versions (${unknownVersionConfigNames.join(',')}) found. ${availableVersionNamesMsg}`);
269
288
  }
@@ -271,7 +290,7 @@ function checkVersionsOptions(availableVersionNames, options) {
271
290
  if (options.onlyIncludeVersions.length === 0) {
272
291
  throw new Error(`Invalid docs option "onlyIncludeVersions": an empty array is not allowed, at least one version is needed.`);
273
292
  }
274
- const unknownOnlyIncludeVersionNames = lodash_1.difference(options.onlyIncludeVersions, availableVersionNames);
293
+ const unknownOnlyIncludeVersionNames = (0, lodash_1.difference)(options.onlyIncludeVersions, availableVersionNames);
275
294
  if (unknownOnlyIncludeVersionNames.length > 0) {
276
295
  throw new Error(`Invalid docs option "onlyIncludeVersions": unknown versions (${unknownOnlyIncludeVersionNames.join(',')}) found. ${availableVersionNamesMsg}`);
277
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "2.0.0-beta.12faed89d",
3
+ "version": "2.0.0-beta.13",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-docs.d.ts",
@@ -17,41 +17,41 @@
17
17
  "directory": "packages/docusaurus-plugin-content-docs"
18
18
  },
19
19
  "license": "MIT",
20
- "devDependencies": {
21
- "@docusaurus/module-type-aliases": "2.0.0-beta.12faed89d",
22
- "@types/js-yaml": "^4.0.0",
23
- "@types/picomatch": "^2.2.1",
24
- "commander": "^5.1.0",
25
- "picomatch": "^2.1.1"
26
- },
27
20
  "dependencies": {
28
- "@docusaurus/core": "2.0.0-beta.12faed89d",
29
- "@docusaurus/mdx-loader": "2.0.0-beta.12faed89d",
30
- "@docusaurus/types": "2.0.0-beta.12faed89d",
31
- "@docusaurus/utils": "2.0.0-beta.12faed89d",
32
- "@docusaurus/utils-validation": "2.0.0-beta.12faed89d",
33
- "chalk": "^4.1.1",
21
+ "@docusaurus/core": "2.0.0-beta.13",
22
+ "@docusaurus/mdx-loader": "2.0.0-beta.13",
23
+ "@docusaurus/utils": "2.0.0-beta.13",
24
+ "@docusaurus/utils-validation": "2.0.0-beta.13",
25
+ "chalk": "^4.1.2",
34
26
  "combine-promises": "^1.1.0",
35
27
  "escape-string-regexp": "^4.0.0",
36
- "execa": "^5.0.0",
37
28
  "fs-extra": "^10.0.0",
38
29
  "globby": "^11.0.2",
39
30
  "import-fresh": "^3.2.2",
40
31
  "js-yaml": "^4.0.0",
41
- "loader-utils": "^1.2.3",
32
+ "loader-utils": "^2.0.0",
42
33
  "lodash": "^4.17.20",
43
34
  "remark-admonitions": "^1.2.1",
44
35
  "shelljs": "^0.8.4",
45
- "tslib": "^2.2.0",
36
+ "tslib": "^2.3.1",
46
37
  "utility-types": "^3.10.0",
47
- "webpack": "^5.40.0"
38
+ "webpack": "^5.61.0"
39
+ },
40
+ "devDependencies": {
41
+ "@docusaurus/module-type-aliases": "2.0.0-beta.13",
42
+ "@docusaurus/types": "2.0.0-beta.13",
43
+ "@types/js-yaml": "^4.0.0",
44
+ "@types/picomatch": "^2.2.1",
45
+ "commander": "^5.1.0",
46
+ "picomatch": "^2.1.1",
47
+ "utility-types": "^3.10.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^16.8.4 || ^17.0.0",
51
51
  "react-dom": "^16.8.4 || ^17.0.0"
52
52
  },
53
53
  "engines": {
54
- "node": ">=12.13.0"
54
+ "node": ">=14"
55
55
  },
56
- "gitHead": "1430dbacfbe9da59a17ce395ed29bdbddaf90049"
56
+ "gitHead": "b6ca12aedf10a10c2375f4f8b7e7380cfd7c7202"
57
57
  }
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with \_:
2
+
3
+ It should be excluded by default
@@ -3,6 +3,11 @@ id: baz
3
3
  title: baz
4
4
  slug: bazSlug.html
5
5
  pagination_label: baz pagination_label
6
+ tags:
7
+ - tag 1
8
+ - tag-1
9
+ - label: tag 2
10
+ permalink: tag2-custom-permalink
6
11
  ---
7
12
 
8
13
  # Baz markdown title
@@ -2,6 +2,8 @@
2
2
  id: hello
3
3
  title: Hello, World !
4
4
  sidebar_label: Hello sidebar_label
5
+ tags: [tag-1, tag 3]
6
+ slug: /
5
7
  ---
6
8
 
7
9
  Hi, Endilie here :)
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: /rootAbsoluteSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: rootRelativeSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: ./hey/ho/../rootResolvedSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: ../../../../../../../../rootTryToEscapeSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -4,7 +4,21 @@
4
4
  {
5
5
  "type": "category",
6
6
  "label": "foo",
7
- "items": ["foo/bar", "foo/baz"]
7
+ "items": ["foo/bar", "foo/baz"]
8
+ },
9
+ {
10
+ "type": "category",
11
+ "label": "Slugs",
12
+ "items": [
13
+ "rootAbsoluteSlug",
14
+ "rootRelativeSlug",
15
+ "rootResolvedSlug",
16
+ "rootTryToEscapeSlug"
17
+ ]
18
+ },
19
+ {
20
+ "type": "doc",
21
+ "id": "headingAsTitle"
8
22
  },
9
23
  {
10
24
  "type": "link",
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  id: hello-1
3
3
  title: Hello 1
4
+ slug: /
4
5
  ---
5
6
 
6
7
  Hello World 1!
@@ -1,4 +1,10 @@
1
1
  ---
2
2
  slug: barSlug
3
+ tags:
4
+ - barTag 1
5
+ - barTag-2
6
+ - label: barTag 3
7
+ permalink: barTag-3-permalink
3
8
  ---
9
+
4
10
  This is `next` version of bar.
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `next` !
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` ! (translated en)
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` ! (translated fr)
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` !
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with \_:
2
+
3
+ It should be excluded by default
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.1` !
@@ -1,7 +1,7 @@
1
1
  {
2
- "version-1.0.1/docs": {
2
+ "VersionedSideBarNameDoesNotMatter/docs": {
3
3
  "Test": [
4
- "version-1.0.1/foo/bar"
4
+ "foo/bar"
5
5
  ],
6
6
  "Guides": [
7
7
  "version-1.0.1/hello"
@@ -2,89 +2,64 @@
2
2
 
3
3
  exports[`docsVersion first time versioning 1`] = `
4
4
  Object {
5
- "version-1.0.0/docs": Array [
6
- Object {
7
- "collapsed": true,
8
- "items": Array [
9
- Object {
10
- "collapsed": true,
11
- "items": Array [
12
- Object {
13
- "id": "version-1.0.0/foo/bar",
14
- "type": "doc",
15
- },
16
- Object {
17
- "id": "version-1.0.0/foo/baz",
18
- "type": "doc",
19
- },
20
- ],
21
- "label": "foo",
22
- "type": "category",
23
- },
24
- Object {
25
- "href": "https://github.com",
26
- "label": "Github",
27
- "type": "link",
28
- },
29
- Object {
30
- "id": "version-1.0.0/hello",
31
- "type": "ref",
32
- },
33
- ],
34
- "label": "Test",
35
- "type": "category",
36
- },
37
- Object {
38
- "collapsed": true,
39
- "items": Array [
40
- Object {
41
- "id": "version-1.0.0/hello",
42
- "type": "doc",
43
- },
44
- ],
45
- "label": "Guides",
46
- "type": "category",
47
- },
48
- ],
5
+ "docs": Object {
6
+ "Guides": Array [
7
+ "hello",
8
+ ],
9
+ "Test": Array [
10
+ Object {
11
+ "items": Array [
12
+ "foo/bar",
13
+ "foo/baz",
14
+ ],
15
+ "label": "foo",
16
+ "type": "category",
17
+ },
18
+ Object {
19
+ "items": Array [
20
+ "rootAbsoluteSlug",
21
+ "rootRelativeSlug",
22
+ "rootResolvedSlug",
23
+ "rootTryToEscapeSlug",
24
+ ],
25
+ "label": "Slugs",
26
+ "type": "category",
27
+ },
28
+ Object {
29
+ "id": "headingAsTitle",
30
+ "type": "doc",
31
+ },
32
+ Object {
33
+ "href": "https://github.com",
34
+ "label": "Github",
35
+ "type": "link",
36
+ },
37
+ Object {
38
+ "id": "hello",
39
+ "type": "ref",
40
+ },
41
+ ],
42
+ },
49
43
  }
50
44
  `;
51
45
 
52
46
  exports[`docsVersion not the first time versioning 1`] = `
53
47
  Object {
54
- "version-2.0.0/docs": Array [
55
- Object {
56
- "collapsed": true,
57
- "items": Array [
58
- Object {
59
- "id": "version-2.0.0/foo/bar",
60
- "type": "doc",
61
- },
62
- ],
63
- "label": "Test",
64
- "type": "category",
65
- },
66
- Object {
67
- "collapsed": true,
68
- "items": Array [
69
- Object {
70
- "id": "version-2.0.0/hello",
71
- "type": "doc",
72
- },
73
- ],
74
- "label": "Guides",
75
- "type": "category",
76
- },
77
- ],
48
+ "docs": Object {
49
+ "Guides": Array [
50
+ "hello",
51
+ ],
52
+ "Test": Array [
53
+ "foo/bar",
54
+ ],
55
+ },
78
56
  }
79
57
  `;
80
58
 
81
59
  exports[`docsVersion second docs instance versioning 1`] = `
82
60
  Object {
83
- "version-2.0.0/community": Array [
84
- Object {
85
- "id": "version-2.0.0/team",
86
- "type": "doc",
87
- },
61
+ "community": Array [
62
+ "team",
88
63
  ],
89
64
  }
90
65
  `;