mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
Bug fixes in generatejs (#169)
* Misc cleanups related to console.log messages in yarn build * Fixes https://github.com/facebookexperimental/Docusaurus/issues/96
This commit is contained in:
parent
c97da9d3f7
commit
fa1ec70432
8 changed files with 18 additions and 27 deletions
|
@ -14,9 +14,9 @@ const siteConfig = require(process.cwd() + "/siteConfig.js");
|
||||||
|
|
||||||
class Users extends React.Component {
|
class Users extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const showcase = siteConfig.users.map(user => {
|
const showcase = siteConfig.users.map((user, i) => {
|
||||||
return (
|
return (
|
||||||
<a href={user.infoLink}>
|
<a href={user.infoLink} key={i}>
|
||||||
<img src={user.image} title={user.caption} />
|
<img src={user.image} title={user.caption} />
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
@ -30,14 +30,11 @@ class Users extends React.Component {
|
||||||
<h1>Who's Using This?</h1>
|
<h1>Who's Using This?</h1>
|
||||||
<p>This project is used by many folks</p>
|
<p>This project is used by many folks</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="logos">
|
<div className="logos">{showcase}</div>
|
||||||
{showcase}
|
|
||||||
</div>
|
|
||||||
<p>Are you using this project?</p>
|
<p>Are you using this project?</p>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/deltice/test-site/edit/master/website/siteConfig.js"
|
href="https://github.com/deltice/test-site/edit/master/website/siteConfig.js"
|
||||||
className="button"
|
className="button">
|
||||||
>
|
|
||||||
Add your company
|
Add your company
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,7 @@ const React = require("react");
|
||||||
const Site = require("./Site.js");
|
const Site = require("./Site.js");
|
||||||
|
|
||||||
// used to generate entire blog pages, i.e. collection of truncated blog posts
|
// used to generate entire blog pages, i.e. collection of truncated blog posts
|
||||||
const BlogPageLayout = React.createClass({
|
class BlogPageLayout extends React.Component {
|
||||||
getPageURL(page) {
|
getPageURL(page) {
|
||||||
let url = this.props.config.baseUrl + "blog/";
|
let url = this.props.config.baseUrl + "blog/";
|
||||||
if (page > 0) {
|
if (page > 0) {
|
||||||
|
@ -66,6 +66,6 @@ const BlogPageLayout = React.createClass({
|
||||||
</Site>
|
</Site>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
module.exports = BlogPageLayout;
|
module.exports = BlogPageLayout;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
const React = require("react");
|
const React = require("react");
|
||||||
const toSlug = require("./toSlug.js");
|
const toSlug = require("./toSlug.js");
|
||||||
|
|
||||||
const Header = React.createClass({
|
class Header extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const slug = toSlug(this.props.toSlug || this.props.children);
|
const slug = toSlug(this.props.toSlug || this.props.children);
|
||||||
const Heading = "h" + this.props.level;
|
const Heading = "h" + this.props.level;
|
||||||
|
@ -23,6 +23,6 @@ const Header = React.createClass({
|
||||||
</Heading>
|
</Heading>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
module.exports = Header;
|
module.exports = Header;
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Redirect extends React.Component {
|
||||||
`
|
`
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</body>{" "}
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,7 +380,7 @@ function execute() {
|
||||||
|
|
||||||
fs.writeFileSync(mainCss, cssContent);
|
fs.writeFileSync(mainCss, cssContent);
|
||||||
} else if (!fs.lstatSync(file).isDirectory()) {
|
} else if (!fs.lstatSync(file).isDirectory()) {
|
||||||
let parts = file.split("static");
|
let parts = file.split("/static/");
|
||||||
let targetFile =
|
let targetFile =
|
||||||
CWD + "/build/" + siteConfig.projectName + "/" + parts[1];
|
CWD + "/build/" + siteConfig.projectName + "/" + parts[1];
|
||||||
mkdirp.sync(targetFile.replace(new RegExp("/[^/]*$"), ""));
|
mkdirp.sync(targetFile.replace(new RegExp("/[^/]*$"), ""));
|
||||||
|
@ -451,7 +451,6 @@ function execute() {
|
||||||
);
|
);
|
||||||
writeFileAndCreateFolder(targetFile, str);
|
writeFileAndCreateFolder(targetFile, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.removeSync(tempFile);
|
fs.removeSync(tempFile);
|
||||||
} else if (!fs.lstatSync(file).isDirectory()) {
|
} else if (!fs.lstatSync(file).isDirectory()) {
|
||||||
// copy other non .js files
|
// copy other non .js files
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Adding RSS Support
|
title: Adding RSS Support - RSS Truncation Test
|
||||||
author: Eric Nakagawa
|
author: Eric Nakagawa
|
||||||
authorURL: http://twitter.com/ericnakagawa
|
authorURL: http://twitter.com/ericnakagawa
|
||||||
authorFBID: 661277173
|
authorFBID: 661277173
|
||||||
|
|
|
@ -7,13 +7,11 @@
|
||||||
"write-translations": "../lib/write-translations.js",
|
"write-translations": "../lib/write-translations.js",
|
||||||
"version": "../lib/version.js",
|
"version": "../lib/version.js",
|
||||||
"rename-version": "../lib/rename-version.js",
|
"rename-version": "../lib/rename-version.js",
|
||||||
"crowdin-upload":
|
"crowdin-upload": "crowdin-cli --config ../crowdin.yaml upload sources --auto-update -b master",
|
||||||
"crowdin-cli --config ../crowdin.yaml upload sources --auto-update -b master",
|
"crowdin-download": "crowdin-cli --config ../crowdin.yaml download -b master"
|
||||||
"crowdin-download":
|
|
||||||
"crowdin-cli --config ../crowdin.yaml download -b master"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^2.5.0",
|
"async": "^2.5.0",
|
||||||
"docusaurus": "^1.0.0-alpha.42"
|
"docusaurus": "../../Docusaurus/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,9 @@ const siteConfig = require(process.cwd() + "/siteConfig.js");
|
||||||
|
|
||||||
class Users extends React.Component {
|
class Users extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const showcase = siteConfig.users.map(user => {
|
const showcase = siteConfig.users.map((user, i) => {
|
||||||
return (
|
return (
|
||||||
<a href={user.infoLink}>
|
<a href={user.infoLink} key={i}>
|
||||||
<img src={user.image} title={user.caption} />
|
<img src={user.image} title={user.caption} />
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
@ -30,14 +30,11 @@ class Users extends React.Component {
|
||||||
<h1>Who's Using This?</h1>
|
<h1>Who's Using This?</h1>
|
||||||
<p>This project is used by many folks</p>
|
<p>This project is used by many folks</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="logos">
|
<div className="logos">{showcase}</div>
|
||||||
{showcase}
|
|
||||||
</div>
|
|
||||||
<p>Are you using this project?</p>
|
<p>Are you using this project?</p>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/facebookexperimental/docusaurus/edit/master/website/siteConfig.js"
|
href="https://github.com/facebookexperimental/docusaurus/edit/master/website/siteConfig.js"
|
||||||
className="button"
|
className="button">
|
||||||
>
|
|
||||||
Add your project
|
Add your project
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue