mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 10:52:35 +02:00
Enable passing attributes to scripts and links (#937)
This commit is contained in:
parent
2cbfeffd81
commit
969399c6c5
2 changed files with 32 additions and 10 deletions
|
@ -137,13 +137,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 =>
|
||||
source.href ? (
|
||||
<link rel="stylesheet" key={source.href} {...source} />
|
||||
) : (
|
||||
<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 =>
|
||||
source.src ? (
|
||||
<script type="text/javascript" key={source.src} {...source} />
|
||||
) : (
|
||||
<script type="text/javascript" src={source} key={source} />
|
||||
)
|
||||
)}
|
||||
|
||||
{this.props.config.scrollToTop && (
|
||||
<script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue