mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
feat(client-redirects-plugin): support fully qualified urls and querystring/hash in destination/to url (#9171)
This commit is contained in:
parent
4ea0a70f93
commit
09ea3bcfab
17 changed files with 260 additions and 44 deletions
|
@ -100,3 +100,30 @@ const dogfoodingPluginInstances = [
|
|||
];
|
||||
|
||||
exports.dogfoodingPluginInstances = dogfoodingPluginInstances;
|
||||
|
||||
exports.dogfoodingRedirects = [
|
||||
{
|
||||
from: ['/home/'],
|
||||
to: '/',
|
||||
},
|
||||
{
|
||||
from: ['/home/qs'],
|
||||
to: '/?a=1',
|
||||
},
|
||||
{
|
||||
from: ['/home/anchor'],
|
||||
to: '/#anchor',
|
||||
},
|
||||
{
|
||||
from: ['/home/absolute'],
|
||||
to: 'https://docusaurus.io/',
|
||||
},
|
||||
{
|
||||
from: ['/home/absolute/qs'],
|
||||
to: 'https://docusaurus.io/?a=1',
|
||||
},
|
||||
{
|
||||
from: ['/home/absolute/anchor'],
|
||||
to: 'https://docusaurus.io/#anchor',
|
||||
},
|
||||
];
|
||||
|
|
|
@ -13,6 +13,7 @@ const VersionsArchived = require('./versionsArchived.json');
|
|||
const {
|
||||
dogfoodingPluginInstances,
|
||||
dogfoodingThemeInstances,
|
||||
dogfoodingRedirects,
|
||||
} = require('./_dogfooding/dogfooding.config');
|
||||
|
||||
/** @type {Record<string,Record<string,string>>} */
|
||||
|
@ -260,6 +261,7 @@ module.exports = async function createConfigAsync() {
|
|||
from: ['/docs/resources', '/docs/next/resources'],
|
||||
to: '/community/resources',
|
||||
},
|
||||
...dogfoodingRedirects,
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue