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