Replies: 2 comments
-
After a quick test I can verify that the error can indeed be fixed by simply adding fonts.googleapis.com to the style-src in config/_default/server.toml. E.g. the new version is: However, config/_default/server.toml says on the first line "# Auto-generated file - do not modify" - so probably not the CORRECT way to fix the issue... What is the correct way to address this? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi @EricAtNRD, thanks for sharing the elaborate context and examples. I realize the docs need some clarification. For now, you can best modify the site parameters in [modules.hinode.csp]
style-src = ["www.youtube.com"]
font-src = ["fonts.gstatic.com"]
frame-src = [
"player.cloudinary.com",
"www.youtube-nocookie.com",
"www.youtube.com"
]
img-src = [
"data:",
"*.imgix.net",
"*.imagekit.io",
"*.cloudinary.com",
"i.ytimg.com"
] Next, run the following npm command to update the various configuration files. This will update the CSP settings for the internal Hugo server, as well as for Netlify. You may need to change this pending your deployment target. npm run build:headers |
Beta Was this translation helpful? Give feedback.
-
Hello,
Enthusiastic Hinode newbie here. I ran into an issue today that does not seem like a bug (probably "works as expected"), but a documentation update might help.
The Issue:
A CSP error is triggered when trying to use a hosted Google font from a local / dev server (even in the simplest case of uncommenting the supplied
themeFontPath
for the external version of the "Inter" font inconfig/_default/params.toml
).To reproduce:
# themeFontPath = "/fonts" # local path
themeFontPath = "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" # external path
Errors:
Presumably this is simply a matter of updating the CSP module configuration (which I have not yet figured out how to do!) or just downloading the fonts locally, but the documentation does not make this clear:
https://gethinode.com/docs/configuration/fonts/
Presumably the best way to address this is to add
fonts.googleapis.com
as astyle-src
as per: https://gethinode.com/docs/advanced-settings/server-headers/Best wishes,
Eric
Beta Was this translation helpful? Give feedback.
All reactions