mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
Code cleanups for consistency & adds Docusaurus to meta tags (#138)
* Add a made with Docusaurus meta tag * Code cleanups and changes for clarity * Add back pages string extraction
This commit is contained in:
parent
fd05bb3239
commit
a4695a3083
4 changed files with 43 additions and 14 deletions
|
@ -121,14 +121,15 @@ function execute(port) {
|
|||
console.log("server.js triggered...");
|
||||
|
||||
reloadMetadata();
|
||||
reloadMetadataBlog();
|
||||
extractTranslations();
|
||||
reloadSiteConfig();
|
||||
|
||||
// handle all requests for document pages
|
||||
const app = express().get(/docs\/.*html$/, (req, res, next) => {
|
||||
extractTranslations();
|
||||
reloadSiteConfig();
|
||||
let url = req.path.toString().replace(siteConfig.baseUrl, "");
|
||||
const app = express();
|
||||
|
||||
reloadMetadata();
|
||||
app.get(/docs\/.*html$/, (req, res, next) => {
|
||||
let url = req.path.toString().replace(siteConfig.baseUrl, "");
|
||||
|
||||
// links is a map from a permalink to an id for each document
|
||||
let links = {};
|
||||
|
@ -240,7 +241,11 @@ function execute(port) {
|
|||
}
|
||||
|
||||
const docComp = (
|
||||
<DocsLayout metadata={metadata} language={language} config={siteConfig} Doc={Doc}>
|
||||
<DocsLayout
|
||||
metadata={metadata}
|
||||
language={language}
|
||||
config={siteConfig}
|
||||
Doc={Doc}>
|
||||
{rawContent}
|
||||
</DocsLayout>
|
||||
);
|
||||
|
@ -277,10 +282,6 @@ function execute(port) {
|
|||
|
||||
// handle all requests for blog pages and posts
|
||||
app.get(/blog\/.*html$/, (req, res) => {
|
||||
extractTranslations();
|
||||
reloadSiteConfig();
|
||||
reloadMetadataBlog();
|
||||
|
||||
// generate all of the blog pages
|
||||
removeModuleAndChildrenFromCache("../core/BlogPageLayout.js");
|
||||
const BlogPageLayout = require("../core/BlogPageLayout.js");
|
||||
|
@ -358,9 +359,6 @@ function execute(port) {
|
|||
|
||||
// handle all other main pages
|
||||
app.get("*.html", (req, res, next) => {
|
||||
extractTranslations();
|
||||
reloadSiteConfig();
|
||||
|
||||
// look for user provided html file first
|
||||
let htmlFile = req.path.toString().replace(siteConfig.baseUrl, "");
|
||||
htmlFile = CWD + "/pages/" + htmlFile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue