I'm attempting to use webfonts a Jekyll build. The fonts are displaying correctly locally, but when pushed to a live environment the fonts don't display. There is a console error of Failed to load resource: the server responded with a status of 404 ()
for each font missing.
The _site
directory is setup like this:
assets/css/style.css
fonts/ <-- all my .woff files are in here
index.html
The CSS file is referenced in the index.html
file like this:
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
The @font-face declaration is like this:
@font-face {
font-family: 'My font';
src: url('../../fonts/myfont.woff2') format('woff2'),
url('../../fonts/myfont.woff') format('woff');
}
Do I need to declare something in the _config.yml
file for this to work correctly?