-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v2): add scripts and stylesheets field to config #1831
Conversation
Deploy preview for docusaurus-2 ready! Built with commit bff9eb6 |
Deploy preview for docusaurus-preview ready! Built with commit bff9eb6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This will make it much easier to migrate.
<link rel="stylesheet" key={source} href={source} /> | ||
), | ||
)} | ||
{scripts && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we inject scripts here in V1? Putting scripts here blocks page rendering which is bad, unless they use async
. Maybe we should allow injecting before </body>
, but that'll be more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep its done like this in v1
I followed the SO link here: https://stackoverflow.com/a/58349826/582917. Is it possible to add in custom HTML tags like |
@CMCDragonkai Please don't necropost—perfect way to get your question undiscoverable. We don't have a first-class API for any tag, but you can get away with a plugin API: // docusaurus.config.js
module.exports = {
// ...
plugins: [
() => ({
name: "inject-tag",
injectHtmlTags() {
return {
headTags: [{ tagName: "base", attributes: { href: "https://www.example.com/" } }],
};
},
}),
],
}; |
Motivation
Add
scripts
andstylesheets
field to docusaurus.config. for v1 parity and enable user to use external resources script or stylesheetsHave you read the Contributing Guidelines on pull requests?
yes
Test Plan
Add random scripts and stylesheets into config