mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
Enable stylesheets as a parallel to scripts (#225)
* Enable stylesheets as a parallel to scripts Also moves the scripts above the custom stylesheet to follow the comment :) * Update api-site-config.md
This commit is contained in:
parent
856ca785e5
commit
c407cdf96f
2 changed files with 16 additions and 8 deletions
|
@ -22,8 +22,6 @@ class Head extends React.Component {
|
|||
const highlightVersion = highlightConfig.version || highlightDefaultVersion;
|
||||
const highlightTheme = highlightConfig.theme || 'default';
|
||||
|
||||
const hasCustomScripts = this.props.config.scripts;
|
||||
|
||||
return (
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
|
@ -79,16 +77,23 @@ class Head extends React.Component {
|
|||
/>
|
||||
)}
|
||||
|
||||
{/* External resources */}
|
||||
{this.props.config.stylesheets && this.props.config.stylesheets.map(function(source) {
|
||||
return (
|
||||
<link rel="stylesheet" href={source} />
|
||||
);
|
||||
})}
|
||||
{this.props.config.scripts && this.props.config.scripts.map(function(source) {
|
||||
return (
|
||||
<script type="text/javascript" src={source} />
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Site defined code. Keep these at the end to avoid overriding. */}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href={this.props.config.baseUrl + "css/main.css"}
|
||||
/>
|
||||
{hasCustomScripts && this.props.config.scripts.map(function(source) {
|
||||
return (
|
||||
<script type="text/javascript" src={source} />
|
||||
);
|
||||
})}
|
||||
</head>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue