-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,13 +134,23 @@ class Head extends React.Component { | |
|
||
{/* External resources */} | ||
{this.props.config.stylesheets && | ||
this.props.config.stylesheets.map(source => ( | ||
<link rel="stylesheet" key={source} href={source} /> | ||
))} | ||
this.props.config.stylesheets.map(source => { | ||
if (source instanceof Object) { | ||
return source.href ? ( | ||
<link rel="stylesheet" key={source.href} {...source} /> | ||
) : null; | ||
} | ||
return <link rel="stylesheet" key={source} href={source} />; | ||
})} | ||
{this.props.config.scripts && | ||
this.props.config.scripts.map(source => ( | ||
<script type="text/javascript" key={source} src={source} /> | ||
))} | ||
this.props.config.scripts.map(source => { | ||
if (source instanceof Object) { | ||
return source.src ? ( | ||
<script type="text/javascript" key={source.src} {...source} /> | ||
) : null; | ||
} | ||
return <script type="text/javascript" key={source} src={source} />; | ||
})} | ||
|
||
{this.props.config.scrollToTop && ( | ||
<script src="https://unpkg.com/[email protected]/dist/vanilla-back-to-top.min.js" /> | ||
|