@docusaurus/plugin-client-redirects 2.0.0-beta.138b4c997 → 2.0.0-beta.14
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/collectRedirects.js +25 -30
- package/lib/createRedirectPageContent.js +3 -5
- package/lib/extensionRedirects.js +17 -7
- package/lib/index.js +8 -16
- package/lib/normalizePluginOptions.js +2 -2
- package/lib/writeRedirectFiles.js +31 -9
- package/package.json +15 -12
- package/src/collectRedirects.ts +32 -36
- package/src/createRedirectPageContent.ts +3 -3
- package/src/extensionRedirects.ts +22 -7
- package/src/index.ts +0 -13
- package/src/normalizePluginOptions.ts +1 -1
- package/src/plugin-client-redirects.d.ts +8 -0
- package/src/writeRedirectFiles.ts +34 -6
- package/lib/.tsbuildinfo +0 -1
- package/src/__tests__/__snapshots__/collectRedirects.test.ts.snap +0 -27
- package/src/__tests__/__snapshots__/createRedirectPageContent.test.ts.snap +0 -29
- package/src/__tests__/__snapshots__/normalizePluginOptions.test.ts.snap +0 -35
- package/src/__tests__/__snapshots__/redirectValidation.test.ts.snap +0 -11
- package/src/__tests__/__snapshots__/writeRedirectFiles.test.ts.snap +0 -147
- package/src/__tests__/collectRedirects.test.ts +0 -340
- package/src/__tests__/createRedirectPageContent.test.ts +0 -26
- package/src/__tests__/extensionRedirects.test.ts +0 -140
- package/src/__tests__/normalizePluginOptions.test.ts +0 -76
- package/src/__tests__/redirectValidation.test.ts +0 -66
- package/src/__tests__/writeRedirectFiles.test.ts +0 -203
- package/tsconfig.json +0 -10
|
@@ -11,7 +11,7 @@ import {memoize} from 'lodash';
|
|
|
11
11
|
|
|
12
12
|
import {PluginContext, RedirectMetadata} from './types';
|
|
13
13
|
import createRedirectPageContent from './createRedirectPageContent';
|
|
14
|
-
import {
|
|
14
|
+
import {normalizeUrl} from '@docusaurus/utils';
|
|
15
15
|
|
|
16
16
|
export type WriteFilesPluginContext = Pick<PluginContext, 'baseUrl' | 'outDir'>;
|
|
17
17
|
|
|
@@ -24,6 +24,34 @@ export function createToUrl(baseUrl: string, to: string): string {
|
|
|
24
24
|
return normalizeUrl([baseUrl, to]);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// Create redirect file path
|
|
28
|
+
// Make sure this path has lower precedence over the original file path when served by host providers!
|
|
29
|
+
// Otherwise it can produce infinite redirect loops!
|
|
30
|
+
//
|
|
31
|
+
// See https://github.com/facebook/docusaurus/issues/5055
|
|
32
|
+
// See https://github.com/facebook/docusaurus/pull/5085
|
|
33
|
+
// See https://github.com/facebook/docusaurus/pull/5102
|
|
34
|
+
function getRedirectFilePath(
|
|
35
|
+
fromPath: string,
|
|
36
|
+
trailingSlash: boolean | undefined, // Now unused, on purpose
|
|
37
|
+
): string {
|
|
38
|
+
const fileName = path.basename(fromPath);
|
|
39
|
+
const filePath = path.dirname(fromPath);
|
|
40
|
+
// Edge case for https://github.com/facebook/docusaurus/pull/5102
|
|
41
|
+
// If the redirect source path is /xyz, with file /xyz.html
|
|
42
|
+
// We can't write the redirect file at /xyz.html/index.html because for Unix FS, a file/folder can't have the same name "xyz.html"
|
|
43
|
+
// The only possible solution for a redirect file is thus /xyz.html.html (I know, looks suspicious)
|
|
44
|
+
if (trailingSlash === false && fileName.endsWith('.html')) {
|
|
45
|
+
return path.join(filePath, `${fileName}.html`);
|
|
46
|
+
}
|
|
47
|
+
// If the target path is /xyz, with file /xyz/index.html, we don't want the redirect file to be /xyz.html
|
|
48
|
+
// otherwise it would be picked in priority and the redirect file would redirect to itself
|
|
49
|
+
// We prefer the redirect file to be /xyz.html/index.html, served with lower priority for most static hosting tools
|
|
50
|
+
else {
|
|
51
|
+
return path.join(filePath, `${fileName}/index.html`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
27
55
|
export function toRedirectFilesMetadata(
|
|
28
56
|
redirects: RedirectMetadata[],
|
|
29
57
|
pluginContext: WriteFilesPluginContext,
|
|
@@ -32,13 +60,13 @@ export function toRedirectFilesMetadata(
|
|
|
32
60
|
// Perf: avoid rendering the template twice with the exact same "props"
|
|
33
61
|
// We might create multiple redirect pages for the same destination url
|
|
34
62
|
// note: the first fn arg is the cache key!
|
|
35
|
-
const createPageContentMemoized = memoize((toUrl: string) =>
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
const createPageContentMemoized = memoize((toUrl: string) =>
|
|
64
|
+
createRedirectPageContent({toUrl}),
|
|
65
|
+
);
|
|
38
66
|
|
|
39
67
|
const createFileMetadata = (redirect: RedirectMetadata) => {
|
|
40
|
-
const
|
|
41
|
-
const fileAbsolutePath = path.join(pluginContext.outDir,
|
|
68
|
+
const fileRelativePath = getRedirectFilePath(redirect.from, trailingSlash);
|
|
69
|
+
const fileAbsolutePath = path.join(pluginContext.outDir, fileRelativePath);
|
|
42
70
|
const toUrl = createToUrl(pluginContext.baseUrl, redirect.to);
|
|
43
71
|
const fileContent = createPageContentMemoized(toUrl);
|
|
44
72
|
return {
|
package/lib/.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/webpack/node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/ajv/lib/ajv.d.ts","../../../node_modules/schema-utils/declarations/ValidationError.d.ts","../../../node_modules/schema-utils/declarations/validate.d.ts","../../../node_modules/schema-utils/declarations/index.d.ts","../../../node_modules/tapable/tapable.d.ts","../../../node_modules/webpack/types.d.ts","../../docusaurus-types/node_modules/commander/typings/index.d.ts","../../../node_modules/joi/lib/index.d.ts","../../docusaurus-types/src/index.d.ts","../src/types.ts","../../docusaurus-utils/lib/posixPath.d.ts","../../docusaurus-utils/lib/getFilePathForRoutePath.d.ts","../../docusaurus-utils/lib/codeTranslationsUtils.d.ts","../../docusaurus-utils/lib/markdownParser.d.ts","../../docusaurus-utils/lib/markdownLinks.d.ts","../../docusaurus-utils/lib/escapePath.d.ts","../../docusaurus-utils/lib/hashUtils.d.ts","../../docusaurus-utils/lib/index.d.ts","../src/extensionRedirects.ts","../../docusaurus-utils-validation/lib/Joi.d.ts","../../docusaurus-utils-validation/lib/validationUtils.d.ts","../../docusaurus-utils-validation/lib/validationSchemas.d.ts","../../docusaurus-utils-validation/lib/index.d.ts","../src/redirectValidation.ts","../../docusaurus-utils-common/lib/applyTrailingSlash.d.ts","../../docusaurus-utils-common/lib/uniq.d.ts","../../docusaurus-utils-common/lib/index.d.ts","../../../node_modules/chalk/index.d.ts","../src/collectRedirects.ts","../../../node_modules/eta/dist/types/compile.d.ts","../../../node_modules/eta/dist/types/storage.d.ts","../../../node_modules/eta/dist/types/config.d.ts","../../../node_modules/eta/dist/types/file-handlers.d.ts","../../../node_modules/eta/dist/types/compile-string.d.ts","../../../node_modules/eta/dist/types/parse.d.ts","../../../node_modules/eta/dist/types/render.d.ts","../../../node_modules/eta/dist/types/containers.d.ts","../../../node_modules/eta/dist/types/index.d.ts","../src/templates/redirectPage.template.html.ts","../src/createRedirectPageContent.ts","../../docusaurus/lib/constants.d.ts","../src/normalizePluginOptions.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/globals.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/console.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/constants.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/diagnostic_channel.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/dns.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/domain.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/events.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/fs.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/http.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/http2.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/https.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/module.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/net.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/os.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/path.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/process.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/readline.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/repl.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/stream.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/timers.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/tls.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/tty.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/url.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/util.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/util/types.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/v8.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/vm.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/ts3.6/base.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/assert.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/base.d.ts","../../../node_modules/@types/fs-extra/node_modules/@types/node/index.d.ts","../../../node_modules/@types/fs-extra/index.d.ts","../src/writeRedirectFiles.ts","../src/index.ts"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"60761e6ea886034af0f294f025a7199360ce4e2c8ba4ec6408bc049cf9b89799","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e","affectsGlobalScope":true},"ea7abf23498b7c214c67fc14f22f41983fbb7bf7c4826c7fcdef542b2022545f","3594c022901a1c8993b0f78a3f534cfb81e7b619ed215348f7f6882f3db02abc","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","782abf371043fc65a987f835a3acfd80602a30c3e2122f6d5756a86bf6913352","509235563ea2b939e1bbe92aae17e71e6a82ceab8f568b45fb4fce7d72523a32","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","4908e4c00832b26ce77a629de8501b0e23a903c094f9e79a7fec313a15da796a","2630a7cbb597e85d713b7ef47f2946d4280d3d4c02733282770741d40672b1a5",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320","3a1e165b22a1cb8df82c44c9a09502fd2b33f160cd277de2cd3a055d8e5c6b27","67f129ed8b372622ff36b8b10e39d03e09e363a5ff7821105f92f085b8d1ccba","327f42ab31ff4539ba868d0374f8825af328b104b5f78d26b2e3ce9cc17b43a0","62a05210201c793349ec28254f06a01814c5b4f5591f6d1921941286db78ea2a","8f877178233f74095130e129ce86128a6a15afcfc6171d714e154863b6a65fe8","b395ec0779c66de885f97974534e95ee2c8bbf9acaf5857a6782ddc32972b6d8","572b4d4c4e2cd3026db925ca5cb721f5c3f4f52938da404de1148a126348f29b","c72b982add26c5ddf410899bcafe3f47253a5d274d4b93d2ef67850d4af4545b","332bc92a89da24ef3a645208f2b3159292460a52fbe63c40eef64c2a63bb1e40","13e5e388b5816cb8325e79b26bae6ba24bcd6f9f22e636f6f4329ccf650f8751","57dc389181eeb619a8b10299e3447cd6d9b216453af993abda5afedd6b39b455","0daf3165e72cc1ed5263a3374b98cb065f78922c76602477973ee0654b99df17","54908e77ad591652580ebdfcc70078a3ae69978e8393a0c95e9e4319fd7d591a","98249526332851a623664fd515a293f50d680d4a86d633585ecb9168e67cd872","3fedee34f24b13af4a97c4184a9e215a6f6b2dfb655dafc24970c76791b06c43","4fae0cbdbb492b0fc847ec76d0a4af44eb04028200cec088d97fca05438213f1","c7642b1c7345e546c81831fe5fa9233e15a12fa2743f6685b0d700af8292cdd0","857d6d4a53c4372a2799e733ab122d28f7b2b580fe58b80a5fe1321a733c20f7","507c590897f90453e6f2e8945a52153d14cc67241ad84d85704df2eb5960a87e","2785a6dc43904230555b9b7a93415322690664a2b62e2eb8539c8c756e2d0eba","889859c907d8388cfe92d4bdfe5b5ff0885a41e6e4568691230e21757f7673c9","d62aae9510ec58d3533a76b9915dae85dea65aa39c915613dc9f47918f596b1e","57e1940021e5e3ff12963f4218195c786a0d2a475a400fffb7cdd4352823854d","01c67feaa6d785a1f958c92f0e1eabdd69bd5e44cbd8a233b89a247ad9bb1dc3","700c2f83a83482242336bf0033edbd961105577f16b9cf549333159fc719add2","f22900d42391c1cd865f34d9b7c9cf292a3af2fba696da93be1904cb90820ed2","efc0cf69f54f6d4fbdcc205cc938f1f6f6f1d63fbcb7b3f912a4755805b05b31","cf20beb00c0275e57881ec614d8da648adea0fc80996e09e66a2bd667f53a2cb","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","82a5a6c28e41407f0f6c9cd82400105b76a005d8210999da1fc28fa50480d7fb","a3cf09a8ce34726b0557b3e51135a6768b464e86b7190355e42f10ba368e9786","dcd04eabb6c23406dc589f688c7a83d25a8aa0c93ee34c0be1114113c32792d6","0a21f90e2ffaf26b305183fd2029a7dd512bb3189a9d6842ba764782e609429e","5560fae6a4c210279d4c913e62dfa82f6ebbc283800e430c4ec54e20216e4b2f","bd868c7a5868f2680d332b85283be6be45edb766a95c4b8034aff7c741ab1aad","5ec0c5db09dfb4f1cd140417dc86fed025bd757d63c11fe2c4148ec12fd20111","2737dcbf71e062619538a0d3075795be33900ccf377d5dae1e90197f95787566","2db6353e2fdcbd2842b5b0a36d11e11ffbff703552e19481a55a63155e14c6be","74175ef96c3d3cb5e7bcaf0387ca4cc3de9f1bf68b42a082d8be5e79178c2c7e","37723b12b6a526579c9a467ab70a9414fc30994e24bd4b9dae41148ed3e112a1","63a254a5a16ee3457a0dd00dedacc0d76cc7897b976ec64d59d149d43c4859b7","4977865ec3570795ce920e30b51b6c345ad782bd804202e80d95fc1a09299a7d","c8c407861245162fcf6c4a65125331964efa6f75972dd908ea0e2ba13ca77b33","c7bdc99177a2a94d25fb13722adaaf5b3291bf70b4d1b27584ba189dd3889ba3",{"version":"7c4064a324cd755a9b281d5795fc6ebd9dd713b1c356220185c61eb1b2d0f1af","affectsGlobalScope":true},"e23424b97418eca3226fd24de079f1203eb70360622e4e093af2aff14d4be6ec","ff16181fe134bb123283eb6777c624f6f3ee3f5c17d70b8447fa68af0935d312","54868134aa26f98b6fbc8d28040d8a0f5e64a1cb0dfac7f059b35cac99d626f2","04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef",{"version":"7ddd5487c03df04c01a8618e06d875e167524902ed3dd9a2a9345a0ef5202d6f","affectsGlobalScope":true},"45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491","dfc747ab8dd5f623055a4c26fd35e8cceca869fd3f1cf09701c941ca3679665a","c9f5f2920ff61d7158417b8440d5181ddc34a3dfef811a5677dd8a9fb91471e9","5cc0a492da3602510b8f5ed1852b1e0390002780d8758fbc8c0cd023ca7085f8","ec7dafafe751a5121f8f1c80201ebe7e7238c47e6329280a73c4d1ca4bb7fa28","64debeb10e4b7ae4ec9e89bfb4e04c6101ab98c3cc806d14e5488607cfec2753",{"version":"2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5","affectsGlobalScope":true},{"version":"a5782d6cea81fe43d2db7ed41e789458c933ab3ab60602f7b5b14c4da3370496","affectsGlobalScope":true},"b86b7ff709a82ef3cba2184136c025989958bad483ffb13e4ca35d720245adf4","05b1c856de9c8f2c09c86a89455e25965342496ebe6d089760a9646c51295c76","c0d983dfc997b446ec8e456dea90e8c0c97ba896d55d7e34dfc351f32c405eb9","b447e123210c68f205f67b20c996c04a1eb64b0e591c5e06e164cd3d3a869b28","13257840c0850d4ebd7c2b17604a9e006f752de76c2400ebc752bc465c330452","42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8","0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d","6ea59cf5479f3fad5db2caa4513d8d06d6cfee8d8df69e7a040c9b5b7f25f39c","e2236264a811ed1d09a2487a433e8f5216ae62378cf233954ae220cf886f6717","3ec1e108d587a5661ec790db607f482605ba9f3830e118ce578e3ffa3c42e22b","100b3bb9d39d2b1b5340f1bf45a52e94ef1692b45232b4ba00fac5c3cc56d331",{"version":"ec1a29ddaecb683aa360df0bd98ab5d4171d2d549554f7c5ab2a5c183a3dcb67","affectsGlobalScope":true},"7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6","992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58","2597718d91e306949d89e285bf34c44192014ef541c3bd7cbb825c022749e974","a6b0abdb67d63ebe964ba5fee31bc3daf10c12eecd46b24d778426010c04c67e","ac4801ebc2355ba32329070123b1cd15891bf71b41dcaf9e75b4744832126a59","fd2298fba0640e7295e7bd545e2dfbfcccbb00c27019e501c87965a02bbdebf6","4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50","71ddd49185b68f27bfac127ef5d22cb2672c278e53e5370d9020ef50ca9c377d","b1ea7a6eaa7608e0e0529aebd323b526a79c6c05a4e519ae5c779675004dcdf1","9fcb033a6208485d8f3fadde31eb5cbcaf99149cff3e40c0dc53ebc6d0dff4e9","7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4","9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5","dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9","f4149f1aa299474c7040a35fe8f8ac2ad078cc1b190415adc1fff3ed52d490ea","3730099ed008776216268a97771de31753ef71e0a7d0ec650f588cba2a06ce44","8d649dbc429d7139a1d9a14ea2bf8af1dc089e0a879447539587463d4b6c248c","60c9e27816ec8ac8df7240598bb086e95b47edfb454c5cbf4003c812e0ed6e39","e361aecf17fc4034b4c122a1564471cdcd22ef3a51407803cb5a5fc020c04d02","4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"fc0ae4a8ad3c762b96f9d2c3700cb879a373458cb0bf3175478e3b4f85f7ef2f","fabbec378e1ddd86fcf2662e716c2b8318acedb664ee3a4cba6f9e8ee8269cf1","b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76","e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b","13c7832f048b08604b7e88b69247aecf955bb7b27a0881c2f7f23bb645435479","8d01c38ccb9af3a4035a68818799e5ef32ccc8cf70bdb83e181e1921d7ad32f6","b9a4105d0aeff4b9d5b694be2efd09c95cfe1ee28784e3a95dfb658aabe539af","da4f3cdbfac5e573bc714b06f64c5346c33a69364981bf6437f058a0099656e0"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"importHelpers":true,"jsx":2,"module":1,"noEmitHelpers":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":6,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[118,154],[152],[151,152],[106,111],[117,118,125,134],[107,117,125],[143],[111,118,126],[134,139],[114,117,125],[115],[114],[117],[117,119,134,142],[117,118],[125,134,142],[117,118,120,125,134,139,142],[120,139,142],[153],[142],[114,117,134],[127],[105],[141],[132,143,146],[117,135],[134],[137],[111,125],[103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],[125],[131],[144],[106,111,117,119,128,134,142,146],[46,48,49,50,51,52,53,54,55,56,57,58],[46,47,49,50,51,52,53,54,55,56,57,58],[47,48,49,50,51,52,53,54,55,56,57,58],[46,47,48,50,51,52,53,54,55,56,57,58],[46,47,48,49,51,52,53,54,55,56,57,58],[46,47,48,49,50,52,53,54,55,56,57,58],[46,47,48,49,50,51,53,54,55,56,57,58],[46,47,48,49,50,51,52,54,55,56,57,58],[46,47,48,49,50,51,52,53,55,56,57,58],[46,47,48,49,50,51,52,53,54,56,57,58],[46,47,48,49,50,51,52,53,54,55,57,58],[46,47,48,49,50,51,52,53,54,55,56,58],[46,47,48,49,50,51,52,53,54,55,56,57],[92],[92,93],[90,91],[90,92],[90,92,93,94,95,96,97],[90,92,93],[60,61,63],[62,63],[60,61,62],[59,63,64,65],[45,58,70,79,84,87,88],[45,58,98,99],[45,58,70,78],[45,69,70,78,88,89,102,156],[45,70,83,101],[45,70,83],[45],[45,69],[45,58,70,78,100,127,155],[66,67,68,131],[85,86],[68],[80,81,82],[80],[69,71,72,73,74,75,76,77]],"referencedMap":[[155,1],[103,2],[153,3],[106,4],[107,5],[108,6],[109,7],[110,8],[111,9],[112,10],[114,11],[115,12],[116,13],[117,13],[118,14],[119,15],[120,16],[121,17],[122,18],[154,19],[123,13],[124,20],[125,21],[127,22],[128,23],[129,24],[132,13],[133,25],[134,26],[135,27],[137,13],[138,28],[139,29],[151,30],[141,31],[142,32],[143,33],[145,27],[147,34],[148,27],[47,35],[48,36],[46,37],[49,38],[50,39],[51,40],[52,41],[53,42],[54,43],[55,44],[56,45],[57,46],[58,47],[94,48],[90,49],[92,50],[97,50],[93,51],[98,52],[95,48],[96,53],[62,54],[64,55],[63,56],[66,57],[89,58],[100,59],[79,60],[157,61],[102,62],[84,63],[99,64],[70,65],[156,66],[69,67],[87,68],[80,69],[83,70],[82,71],[81,71],[78,72]],"exportedModulesMap":[[155,1],[103,2],[153,3],[106,4],[107,5],[108,6],[109,7],[110,8],[111,9],[112,10],[114,11],[115,12],[116,13],[117,13],[118,14],[119,15],[120,16],[121,17],[122,18],[154,19],[123,13],[124,20],[125,21],[127,22],[128,23],[129,24],[132,13],[133,25],[134,26],[135,27],[137,13],[138,28],[139,29],[151,30],[141,31],[142,32],[143,33],[145,27],[147,34],[148,27],[47,35],[48,36],[46,37],[49,38],[50,39],[51,40],[52,41],[53,42],[54,43],[55,44],[56,45],[57,46],[58,47],[94,48],[90,49],[92,50],[97,50],[93,51],[98,52],[95,48],[96,53],[62,54],[64,55],[63,56],[66,57],[89,58],[100,59],[79,60],[157,61],[102,62],[84,63],[99,64],[70,65],[156,66],[69,67],[87,68],[80,69],[83,70],[82,71],[81,71],[78,72]],"semanticDiagnosticsPerFile":[155,152,103,105,153,106,107,108,109,110,111,112,113,114,115,116,117,118,119,104,149,120,121,122,154,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,151,141,142,143,144,145,146,150,147,148,60,47,48,46,49,50,51,52,53,54,55,56,57,58,61,88,94,90,92,97,93,98,95,96,91,68,62,64,63,65,45,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,59,66,89,100,79,157,102,84,99,70,156,67,69,85,87,86,80,83,82,81,73,76,72,77,78,75,74,71,101]},"version":"4.3.2"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`collectRedirects should throw if plugin option redirects contain invalid to paths 1`] = `
|
|
4
|
-
"You are trying to create client-side redirections to paths that do not exist:
|
|
5
|
-
- /this/path/does/not/exist2
|
|
6
|
-
- /this/path/does/not/exist2
|
|
7
|
-
|
|
8
|
-
Valid paths you can redirect to:
|
|
9
|
-
- /
|
|
10
|
-
- /someExistingPath
|
|
11
|
-
- /anotherExistingPath
|
|
12
|
-
"
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`collectRedirects should throw if redirect creator creates array of array redirect 1`] = `
|
|
16
|
-
"Some created redirects are invalid:
|
|
17
|
-
- {\\"from\\":[\\"/fromPath\\"],\\"to\\":\\"/\\"} => Validation error: \\"from\\" must be a string
|
|
18
|
-
"
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`collectRedirects should throw if redirect creator creates invalid redirects 1`] = `
|
|
22
|
-
"Some created redirects are invalid:
|
|
23
|
-
- {\\"from\\":\\"https://google.com/\\",\\"to\\":\\"/\\"} => Validation error: \\"from\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string.
|
|
24
|
-
- {\\"from\\":\\"//abc\\",\\"to\\":\\"/\\"} => Validation error: \\"from\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string.
|
|
25
|
-
- {\\"from\\":\\"/def?queryString=toto\\",\\"to\\":\\"/\\"} => Validation error: \\"from\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string.
|
|
26
|
-
"
|
|
27
|
-
`;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`createRedirectPageContent should encode uri special chars 1`] = `
|
|
4
|
-
"<!DOCTYPE html>
|
|
5
|
-
<html>
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset=\\"UTF-8\\">
|
|
8
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/gr/%CF%83%CE%B5%CE%BB%CE%B9%CE%B4%CE%B1%CF%82/\\">
|
|
9
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/gr/%CF%83%CE%B5%CE%BB%CE%B9%CE%B4%CE%B1%CF%82/\\" />
|
|
10
|
-
</head>
|
|
11
|
-
<script>
|
|
12
|
-
window.location.href = 'https://docusaurus.io/gr/%CF%83%CE%B5%CE%BB%CE%B9%CE%B4%CE%B1%CF%82/';
|
|
13
|
-
</script>
|
|
14
|
-
</html>"
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
exports[`createRedirectPageContent should match snapshot 1`] = `
|
|
18
|
-
"<!DOCTYPE html>
|
|
19
|
-
<html>
|
|
20
|
-
<head>
|
|
21
|
-
<meta charset=\\"UTF-8\\">
|
|
22
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/\\">
|
|
23
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/\\" />
|
|
24
|
-
</head>
|
|
25
|
-
<script>
|
|
26
|
-
window.location.href = 'https://docusaurus.io/';
|
|
27
|
-
</script>
|
|
28
|
-
</html>"
|
|
29
|
-
`;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`normalizePluginOptions should reject bad createRedirects user inputs 1`] = `
|
|
4
|
-
"Invalid @docusaurus/plugin-client-redirects options: \\"createRedirects\\" must be of type function
|
|
5
|
-
{
|
|
6
|
-
\\"createRedirects\\": [
|
|
7
|
-
\\"bad\\",
|
|
8
|
-
\\"value\\"
|
|
9
|
-
]
|
|
10
|
-
}"
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`normalizePluginOptions should reject bad fromExtensions user inputs 1`] = `
|
|
14
|
-
"Invalid @docusaurus/plugin-client-redirects options: \\"fromExtensions[0]\\" contains an invalid value
|
|
15
|
-
{
|
|
16
|
-
\\"fromExtensions\\": [
|
|
17
|
-
null,
|
|
18
|
-
null,
|
|
19
|
-
123,
|
|
20
|
-
true
|
|
21
|
-
]
|
|
22
|
-
}"
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
exports[`normalizePluginOptions should reject bad toExtensions user inputs 1`] = `
|
|
26
|
-
"Invalid @docusaurus/plugin-client-redirects options: \\"toExtensions[0]\\" contains an invalid value
|
|
27
|
-
{
|
|
28
|
-
\\"toExtensions\\": [
|
|
29
|
-
null,
|
|
30
|
-
null,
|
|
31
|
-
123,
|
|
32
|
-
true
|
|
33
|
-
]
|
|
34
|
-
}"
|
|
35
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`validateRedirect throw for bad redirects 1`] = `"{\\"from\\":\\"https://fb.com/fromSomePath\\",\\"to\\":\\"/toSomePath\\"} => Validation error: \\"from\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
|
|
4
|
-
|
|
5
|
-
exports[`validateRedirect throw for bad redirects 2`] = `"{\\"from\\":\\"/fromSomePath\\",\\"to\\":\\"https://fb.com/toSomePath\\"} => Validation error: \\"to\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
|
|
6
|
-
|
|
7
|
-
exports[`validateRedirect throw for bad redirects 3`] = `"{\\"from\\":\\"/fromSomePath\\",\\"to\\":\\"/toSomePath?queryString=xyz\\"} => Validation error: \\"to\\" is not a valid pathname. Pathname should start with slash and not contain any domain or query string."`;
|
|
8
|
-
|
|
9
|
-
exports[`validateRedirect throw for bad redirects 4`] = `"{\\"from\\":null,\\"to\\":\\"/toSomePath?queryString=xyz\\"} => Validation error: \\"from\\" must be a string"`;
|
|
10
|
-
|
|
11
|
-
exports[`validateRedirect throw for bad redirects 5`] = `"{\\"from\\":[\\"heyho\\"],\\"to\\":\\"/toSomePath?queryString=xyz\\"} => Validation error: \\"from\\" must be a string"`;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`toRedirectFilesMetadata should create appropriate metadatas for empty baseUrl: fileContent baseUrl=empty 1`] = `
|
|
4
|
-
Array [
|
|
5
|
-
"<!DOCTYPE html>
|
|
6
|
-
<html>
|
|
7
|
-
<head>
|
|
8
|
-
<meta charset=\\"UTF-8\\">
|
|
9
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=/abc\\">
|
|
10
|
-
<link rel=\\"canonical\\" href=\\"/abc\\" />
|
|
11
|
-
</head>
|
|
12
|
-
<script>
|
|
13
|
-
window.location.href = '/abc';
|
|
14
|
-
</script>
|
|
15
|
-
</html>",
|
|
16
|
-
]
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
exports[`toRedirectFilesMetadata should create appropriate metadatas for root baseUrl: fileContent baseUrl=/ 1`] = `
|
|
20
|
-
Array [
|
|
21
|
-
"<!DOCTYPE html>
|
|
22
|
-
<html>
|
|
23
|
-
<head>
|
|
24
|
-
<meta charset=\\"UTF-8\\">
|
|
25
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=/abc\\">
|
|
26
|
-
<link rel=\\"canonical\\" href=\\"/abc\\" />
|
|
27
|
-
</head>
|
|
28
|
-
<script>
|
|
29
|
-
window.location.href = '/abc';
|
|
30
|
-
</script>
|
|
31
|
-
</html>",
|
|
32
|
-
]
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
exports[`toRedirectFilesMetadata should create appropriate metadatas trailingSlash=false: fileContent 1`] = `
|
|
36
|
-
Array [
|
|
37
|
-
"<!DOCTYPE html>
|
|
38
|
-
<html>
|
|
39
|
-
<head>
|
|
40
|
-
<meta charset=\\"UTF-8\\">
|
|
41
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/abc\\">
|
|
42
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/abc\\" />
|
|
43
|
-
</head>
|
|
44
|
-
<script>
|
|
45
|
-
window.location.href = 'https://docusaurus.io/abc';
|
|
46
|
-
</script>
|
|
47
|
-
</html>",
|
|
48
|
-
"<!DOCTYPE html>
|
|
49
|
-
<html>
|
|
50
|
-
<head>
|
|
51
|
-
<meta charset=\\"UTF-8\\">
|
|
52
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/def.html\\">
|
|
53
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/def.html\\" />
|
|
54
|
-
</head>
|
|
55
|
-
<script>
|
|
56
|
-
window.location.href = 'https://docusaurus.io/def.html';
|
|
57
|
-
</script>
|
|
58
|
-
</html>",
|
|
59
|
-
"<!DOCTYPE html>
|
|
60
|
-
<html>
|
|
61
|
-
<head>
|
|
62
|
-
<meta charset=\\"UTF-8\\">
|
|
63
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/\\">
|
|
64
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/\\" />
|
|
65
|
-
</head>
|
|
66
|
-
<script>
|
|
67
|
-
window.location.href = 'https://docusaurus.io/';
|
|
68
|
-
</script>
|
|
69
|
-
</html>",
|
|
70
|
-
]
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
|
-
exports[`toRedirectFilesMetadata should create appropriate metadatas trailingSlash=true: fileContent 1`] = `
|
|
74
|
-
Array [
|
|
75
|
-
"<!DOCTYPE html>
|
|
76
|
-
<html>
|
|
77
|
-
<head>
|
|
78
|
-
<meta charset=\\"UTF-8\\">
|
|
79
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/abc\\">
|
|
80
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/abc\\" />
|
|
81
|
-
</head>
|
|
82
|
-
<script>
|
|
83
|
-
window.location.href = 'https://docusaurus.io/abc';
|
|
84
|
-
</script>
|
|
85
|
-
</html>",
|
|
86
|
-
"<!DOCTYPE html>
|
|
87
|
-
<html>
|
|
88
|
-
<head>
|
|
89
|
-
<meta charset=\\"UTF-8\\">
|
|
90
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/def.html\\">
|
|
91
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/def.html\\" />
|
|
92
|
-
</head>
|
|
93
|
-
<script>
|
|
94
|
-
window.location.href = 'https://docusaurus.io/def.html';
|
|
95
|
-
</script>
|
|
96
|
-
</html>",
|
|
97
|
-
"<!DOCTYPE html>
|
|
98
|
-
<html>
|
|
99
|
-
<head>
|
|
100
|
-
<meta charset=\\"UTF-8\\">
|
|
101
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/\\">
|
|
102
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/\\" />
|
|
103
|
-
</head>
|
|
104
|
-
<script>
|
|
105
|
-
window.location.href = 'https://docusaurus.io/';
|
|
106
|
-
</script>
|
|
107
|
-
</html>",
|
|
108
|
-
]
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
exports[`toRedirectFilesMetadata should create appropriate metadatas trailingSlash=undefined: fileContent 1`] = `
|
|
112
|
-
Array [
|
|
113
|
-
"<!DOCTYPE html>
|
|
114
|
-
<html>
|
|
115
|
-
<head>
|
|
116
|
-
<meta charset=\\"UTF-8\\">
|
|
117
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/abc\\">
|
|
118
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/abc\\" />
|
|
119
|
-
</head>
|
|
120
|
-
<script>
|
|
121
|
-
window.location.href = 'https://docusaurus.io/abc';
|
|
122
|
-
</script>
|
|
123
|
-
</html>",
|
|
124
|
-
"<!DOCTYPE html>
|
|
125
|
-
<html>
|
|
126
|
-
<head>
|
|
127
|
-
<meta charset=\\"UTF-8\\">
|
|
128
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/def.html\\">
|
|
129
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/def.html\\" />
|
|
130
|
-
</head>
|
|
131
|
-
<script>
|
|
132
|
-
window.location.href = 'https://docusaurus.io/def.html';
|
|
133
|
-
</script>
|
|
134
|
-
</html>",
|
|
135
|
-
"<!DOCTYPE html>
|
|
136
|
-
<html>
|
|
137
|
-
<head>
|
|
138
|
-
<meta charset=\\"UTF-8\\">
|
|
139
|
-
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/\\">
|
|
140
|
-
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/\\" />
|
|
141
|
-
</head>
|
|
142
|
-
<script>
|
|
143
|
-
window.location.href = 'https://docusaurus.io/';
|
|
144
|
-
</script>
|
|
145
|
-
</html>",
|
|
146
|
-
]
|
|
147
|
-
`;
|