mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-08 22:57:20 +02:00
* fix bad routing regex for docs & blogs * extract to routing.js & add test * add more test case * address code review * prettier
20 lines
504 B
JavaScript
20 lines
504 B
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
const escapeStringRegexp = require('escape-string-regexp');
|
|
|
|
function docsRouting(baseUrl) {
|
|
return new RegExp(`^${escapeStringRegexp(baseUrl)}docs\/.*html$`);
|
|
}
|
|
|
|
function blogRouting(baseUrl) {
|
|
return new RegExp(`^${escapeStringRegexp(baseUrl)}blog\/.*html$`);
|
|
}
|
|
|
|
module.exports = {
|
|
docsRouting,
|
|
blogRouting,
|
|
};
|