How to add custom local font to Jekyll website?

I have a custom icon exported from Icomoon and am trying to figure out how to include it in my Jekyll website (I'm a little new to Jekyll!). I added the directory exported from Icomoon to my resource folder, and I included the line:

@include embed-font ("Icomoon", "../assets/fonts/font/icomoon.ttf"); 

in my CSS and added to my configuration file:

 assets: sources: -_assets/fonts 

but I get an error: "undefined mixin 'embed-font' in line 2 of my CSS.

Does anyone know what steps I can take to integrate this correctly? Or are there any resources / tutorials for this? I feel really lost.

+7
fonts config icons assets jekyll
source share
1 answer

Instead of using @include, try @ font-face instead:

 @font-face { font-family: "Icomoon"; src: url("../assets/fonts/font/icomoon.tff"); } 

Link: https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Web_fonts

0
source share

All Articles