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:
Christopher Chedeau 2017-11-13 17:54:24 -08:00 committed by Joel Marcey
parent 856ca785e5
commit c407cdf96f
2 changed files with 16 additions and 8 deletions

View file

@ -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>
);
}