Add support for a custom CSS file that is configurable from siteConfig.js

This commit is contained in:
Eric Nakagawa 2017-09-22 11:28:38 -07:00
parent 8e9808c0f4
commit 9c6fe348d6
4 changed files with 10 additions and 1 deletions

View file

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

View file

@ -0,0 +1 @@
/* your custom css */

View file

@ -39,6 +39,11 @@ class Head extends React.Component {
rel="stylesheet" rel="stylesheet"
href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"
/>} />}
{this.props.config.customCssFileName &&
<link
rel="stylesheet"
href={this.props.config.baseUrl + "css/" + this.props.config.customCssFileName}
/>}
<link <link
rel="stylesheet" rel="stylesheet"
href={this.props.config.baseUrl + "css/main.css"} href={this.props.config.baseUrl + "css/main.css"}

View file

@ -43,7 +43,7 @@ const siteConfig = {
{ doc: "installation", label: "Docs" }, { doc: "installation", label: "Docs" },
{ page: "help", label: "Help" }, { page: "help", label: "Help" },
{ blog: true, label: "Blog" }, { blog: true, label: "Blog" },
{ languages: true }, { languages: false },
{ {
href: "https://github.com/facebookexperimental/docusaurus", href: "https://github.com/facebookexperimental/docusaurus",
label: "GitHub" label: "GitHub"
@ -58,6 +58,7 @@ const siteConfig = {
apiKey: "3eb9507824b8be89e7a199ecaa1a9d2c", apiKey: "3eb9507824b8be89e7a199ecaa1a9d2c",
indexName: "docusaurus" indexName: "docusaurus"
}, },
// customCssFileName: "custom.css", //the name of your custom css file
colors: { colors: {
primaryColor: "#2E8555", primaryColor: "#2E8555",
secondaryColor: "#205C3B", secondaryColor: "#205C3B",