mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
Add support for a custom CSS file that is configurable from siteConfig.js
This commit is contained in:
parent
8e9808c0f4
commit
9c6fe348d6
4 changed files with 10 additions and 1 deletions
|
@ -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",
|
||||
|
|
1
examples/basics/static/css/custom.css
Normal file
1
examples/basics/static/css/custom.css
Normal file
|
@ -0,0 +1 @@
|
|||
/* your custom css */
|
|
@ -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"}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue