-
Notifications
You must be signed in to change notification settings - Fork 985
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
Where to put static content? (Fonts, specifically) #2686
Comments
They should go in the static folder: https://www.getzola.org/documentation/getting-started/directory-structure/#static |
Okay, but as I explained in my original post, this 404's. |
Do you have a repo showing the minimum site having the issue? If you build the site and check the public folder, do you see the font in there? What's the path used in the font-face? |
I do see the font files in there when building the site, but I can't test it because none of the content will load due to |
I don't know whether the
@font-face {
font-family: "Source Han Sans JP VF";
src: local("Source Han Sans JP VF"),
url(../fonts/SourceHanSansJP-VF.otf.woff2) format("woff2");
}
...
:lang(ja) {
font-family: "Source Han Sans JP VF";
}
...
<link rel="stylesheet" href="{{ get_url(path='style/shared.css') }}">
... |
@dei-layborer Have you added the string I use custom fonts all the time in my Zola sites and there's no issue with them, I put the fonts in a |
Hi -- thank you for the reply, and apologies for the delayed response. To clarify, which |
Documentation Issue
I'm assuming this is a documentation thing rather than a bug with Zola.
I'd like to include my own font files with the site, and include them via a CSS
@font-face
rule. However, it's not clear how to do this. I've created the rule in the top-level scss file for the theme I'm using, and tried putting the font files themselves in multiple directories within the site (for example,/static/
both in the site itself and the theme's subdirectory). No matter what, when viewing the site viazola serve
, the font files don't load (they 404).I also tried the same process using
zola build
, but the site itself broke due to a host ofOpaqueResponseBlocking
issues from within Firefox. I don't know if it's related.Anyway, my assumption as I said is not that this is something Zola can't do at all, just that I haven't figured out how to do it. Meanwhile, the documentation is, as far as I can tell, entirely silent on how this works.
The text was updated successfully, but these errors were encountered: