mardi 29 décembre 2020

Hugo theme and local font with sass

Now, I use for a little project a Hugo theme blog called Persian. I'm trying it in gitlab and I want to use local fonts. Well, the problem is that I can't achieve load the fonts. Here the structure of my files on the exampleSite folder:

resources
└──_gen
    └── assets
          ├── scss
          │    ├── style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content
          │    └── style.scss_f300667da4f5b5f84e1a9e0702b2fdde.json
          │ 
          └── fonts
               └── Open-Sans.woff2

On the file style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content I wrote the next lines:

@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/openSans.woff2') format('woff2');
}

But, when I call the font in other css rule doesn't work:

.class {
    font-family: "OpenSans"; /*this line doesn't work*/
}



Aucun commentaire:

Enregistrer un commentaire