-
On the themeConfig->metadata object, I'm unsure on how to add the following script tag: <script id="usercentrics-cmp" src="https://app.usercentrics.eu/browser-ui/latest/loader.js" data-settings-id="ID" async></script> My attempt (not sure if this is correct at all): {
tagName: 'script',
async: true,
attributes: {
id: 'usercentrics-cmp',
src: 'https://app.usercentrics.eu/browser-ui/latest/loader.js',
'data-settings-id': 'ID',
}
}, What would be the correct way for adding a script tag that also has an id and data attribute? Would this be correct? |
Beta Was this translation helpful? Give feedback.
Answered by
slorber
Apr 3, 2024
Replies: 1 comment 10 replies
-
We have multiple ways to do that, but what makes you think this one is incorrect? Isn't the tag in the output HTML when you add it this way? |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you think there's a bug, show it with a repro.
It's possible there is a bug, but unless a repro is provided it's not proven.
Afaik headTags are not a
themeConfig
attribute but asiteConfig
attribute. It might just be a docs typo on the SEO docs page.https://docusaurus.io/docs/next/api/docusaurus-config#headTags
themeConfig.metadata
should work<Head>
is not deprecated. You can achieve the same result in multiple ways according to your need.<Head>
is the most granular and can be applied on a per-page basis