mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Move Docusaurus 1 files into directory (#966)
* Move Docusaurus 1 into v1 directory * Update Circle CI commands for new v1 dir * Remove OC * Fix tests
This commit is contained in:
parent
9d4a5d5359
commit
f2927a9fc4
291 changed files with 7591 additions and 6532 deletions
46
v1/lib/server/routing.js
Normal file
46
v1/lib/server/routing.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
function blog(baseUrl) {
|
||||
return new RegExp(`^${baseUrl}blog/.*html$`);
|
||||
}
|
||||
|
||||
function docs(baseUrl) {
|
||||
return new RegExp(`^${baseUrl}docs/.*html$`);
|
||||
}
|
||||
|
||||
function dotfiles() {
|
||||
return /(?!.*html$)^\/.*\.[^\n/]+$/;
|
||||
}
|
||||
|
||||
function feed(baseUrl) {
|
||||
return new RegExp(`^${baseUrl}blog/(feed.xml|atom.xml)$`);
|
||||
}
|
||||
|
||||
function noExtension() {
|
||||
return /\/[^.]*\/?$/;
|
||||
}
|
||||
|
||||
function page(baseUrl) {
|
||||
const gr = regex => regex.toString().replace(/(^\/|\/$)/gm, '');
|
||||
return new RegExp(
|
||||
`(?!${gr(docs(baseUrl))}|${gr(blog(baseUrl))})^${baseUrl}.*.html$`,
|
||||
);
|
||||
}
|
||||
|
||||
function sitemap(baseUrl) {
|
||||
return new RegExp(`^${baseUrl}sitemap.xml$`);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
blog,
|
||||
docs,
|
||||
dotfiles,
|
||||
feed,
|
||||
page,
|
||||
noExtension,
|
||||
sitemap,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue