Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Using @font-face webfonts in a Jekyll build

$
0
0

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?


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>