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",
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

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

View file

@ -39,6 +39,11 @@ class Head extends React.Component {
rel="stylesheet"
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
rel="stylesheet"
href={this.props.config.baseUrl + "css/main.css"}

View file

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