Importing fonts into hugo

@font-face {
font-family: ‘Aeonik’;
src: url(‘…/fonts/Aeonik-Medium.woff2’) format(‘woff2’),
url(‘…/fonts/Aeonik-Medium.woff’) format(‘woff’);
font-weight: medium;
font-style: normal;
font-display: swap;
}

This is my code to import my font but it doesnt seem to work
The css is located in:
“theme/assets/styles/font.css”
The font is located in:
“theme/assets/fonts/fontName.woff”

Obviously, the font is not where you think it is. Try putting it in /static/fonts (which, btw, a search here in the forum would’ve told you).

The /assets directory is used for Resources (see documentation) and pipes. The static directory is used for static resources that don’t need further processing.

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.