Merge pull request #88 from ericnakagawa/master

Removed a redundant feature, added an error message to help troubleshooting building localized sites.
This commit is contained in:
Eric Nakagawa 2017-09-26 10:22:43 -07:00 committed by GitHub
commit effd1113ad
5 changed files with 15 additions and 8 deletions

View file

@ -34,8 +34,6 @@ const siteConfig = {
headerIcon: "img/docusaurus.svg",
footerIcon: "img/docusaurus.svg",
favicon: "img/favicon.png",
/* the name of your custom css file that resides in static/css/ */
// customCssFileName: "custom.css",
/* colors for website */
colors: {
primaryColor: "#2E8555",

View file

@ -43,11 +43,6 @@ class Head extends React.Component {
rel="stylesheet"
href={this.props.config.baseUrl + "css/main.css"}
/>
{this.props.config.customCssFileName &&
<link
rel="stylesheet"
href={this.props.config.baseUrl + "css/" + this.props.config.customCssFileName}
/>}
<script async defer src="https://buttons.github.io/buttons.js" />
</head>
);

View file

@ -136,6 +136,13 @@ class HeaderNav extends React.Component {
link.doc;
}
if (!Metadata[id]) {
if (id != link.doc) {
throw new Error(
"It looks like you've enabled language support, but haven't provided translated files. The document with id: '" +
id +
"' doesn't exist."
);
}
throw new Error(
"A headerLink is specified with a document that does not exist. No document exists with id: " +
link.doc

View file

@ -12,6 +12,7 @@ const CWD = process.cwd();
const path = require("path");
const fs = require("fs");
const glob = require("glob");
const chalk = require("chalk");
const siteConfig = require(CWD + "/siteConfig.js");
const versionFallback = require("./versionFallback.js");
@ -271,6 +272,13 @@ function generateBlogMetadata() {
const metadatas = [];
let files = glob.sync(CWD + "/blog/**/*.*");
if (!files || files.length == 0) {
console.error(
`${chalk.yellow(
CWD + "/blog/ appears to be empty"
)} Make sure you've put your blog files in your Docusaurus 'website' folder.`
);
}
files.sort().reverse().forEach(file => {
const extension = path.extname(file);
if (extension !== ".md" && extension !== ".markdown") {

View file

@ -58,7 +58,6 @@ const siteConfig = {
apiKey: "3eb9507824b8be89e7a199ecaa1a9d2c",
indexName: "docusaurus"
},
customCssFileName: "custom.css", //the name of your custom css file
colors: {
primaryColor: "#2E8555",
secondaryColor: "#205C3B",