mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Clean up API changes
This commit is contained in:
parent
419e0c0ff9
commit
6d2b6740c1
3 changed files with 10 additions and 17 deletions
|
@ -9,7 +9,6 @@
|
|||
|
||||
function execute(port) {
|
||||
const translation = require("./translation.js");
|
||||
const CWD = process.cwd();
|
||||
const express = require("express");
|
||||
const React = require("react");
|
||||
const request = require("request");
|
||||
|
@ -21,9 +20,12 @@ function execute(port) {
|
|||
const mkdirp = require("mkdirp");
|
||||
const glob = require("glob");
|
||||
const translate = require("./translate.js");
|
||||
let siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
const CWD = process.cwd();
|
||||
const ENABLE_TRANSLATION = fs.existsSync(CWD + "/languages.js");
|
||||
|
||||
let siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
/**
|
||||
* Removes a module from the cache
|
||||
*/
|
||||
|
@ -125,8 +127,6 @@ function execute(port) {
|
|||
purgeCache(CWD + "/siteConfig.js");
|
||||
siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
console.log(req.path);
|
||||
|
||||
reloadMetadata();
|
||||
let links = {};
|
||||
for (let i = 0; i < Metadata.length; i++) {
|
||||
|
@ -146,10 +146,9 @@ function execute(port) {
|
|||
}
|
||||
mdToHtml[metadata.source] = siteConfig.baseUrl + metadata.permalink;
|
||||
}
|
||||
console.log(mdToHtml);
|
||||
|
||||
let file = links[req.path.toString().replace(siteConfig.baseUrl, "")];
|
||||
console.log(file);
|
||||
|
||||
if (!fs.existsSync(file)) {
|
||||
next();
|
||||
return;
|
||||
|
@ -190,8 +189,6 @@ function execute(port) {
|
|||
});
|
||||
/* handle all requests for blog pages and posts */
|
||||
app.get(/blog\/.*html$/, (req, res) => {
|
||||
console.log(req.path);
|
||||
|
||||
purgeCache(CWD + "/siteConfig.js");
|
||||
siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
|
@ -283,8 +280,6 @@ function execute(port) {
|
|||
purgeCache(CWD + "/siteConfig.js");
|
||||
siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
console.log(req.path);
|
||||
|
||||
/* look for user provided html file first */
|
||||
let htmlFile = req.path.toString().replace(siteConfig.baseUrl, "");
|
||||
htmlFile = CWD + "/pages/" + htmlFile;
|
||||
|
@ -362,7 +357,6 @@ function execute(port) {
|
|||
|
||||
res.send(str);
|
||||
} else {
|
||||
console.log(req.path);
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue