We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I can't import an external script in the head. There is probably something I don't do correctly...
To Reproduce Here is what I try to do in the shared component
export const sharedPageComponents: SharedLayout = { head: Component.Head( {externalResources: {js: [{src: "https://kit.fontawesome.com/foo.js", crossorigin: "anonymous", loadTime: "beforeDOMReady"}]}}, ),
Expected behavior The script should appear in the <head> tag
<head>
Desktop (please complete the following information):
node
npm
The text was updated successfully, but these errors were encountered:
This is undocumented atm, but you have to add external js source at transformers layers,
so if you want this then add it to quartz/plugins/transformers/ofm.ts or any of the transformers you use
Sorry, something went wrong.
Thanks ! It works perfectly for me. Here is the diff in case somebody wants the same thing
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 94cc7b6..2207659 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -826,6 +826,13 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>> }) } + css.push({ + content: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css", + inline: false, + }) + return { js, css } }, }
diff.txt
No branches or pull requests
Describe the bug
I can't import an external script in the head. There is probably something I don't do correctly...
To Reproduce
Here is what I try to do in the shared component
Expected behavior
The script should appear in the
<head>
tagDesktop (please complete the following information):
node
Version: v22.11.0npm
version: 10.9.0The text was updated successfully, but these errors were encountered: