Hugo + BS5, can't load mulitple custom fonts

My custom .woff2 fonts are declared with @font-face in my main.css files
Path for my fonts URL: static/fonts/

My “Playfair display” font loads but I want a different font for p and h6 for example.

Why can’t I load 2 different fonts at the same time ?!!

I would really appreciate some help.
Do I need to you scss? I have no Idea how.

first off, you mention SCSS but the file in question has .css has an extension.
Please make sure that it is compiled, by testing for SASS-specific code, like

body {p {::first-letter { font-size: 88px !important}}}

that should be very visible. or else, just provide a sample repository…

Hello !

I tried, it doesn’t produce any change.

Though I don’t have a scss file set-up in my assets yet however I read I may need to use scss to solve my custom fonts issue. But I don’t know how or what to do once I have set up an ‘assets/scss’ folder.

I’ve made a sample repository.

I can’t style with my ‘inter’ font but playfair display works. I have no idea what to do.
I’d appreciate it if you could suggest what my next move should be to do. Many thanks.

Look here:

Hugo publishes assets to the publishDir (typically public) when you invoke .Permalink, .RelPermalink, or .Publish. You can use .Content to inline the asset.

Just creating a folder under assets/ ain’t gonna help. I’ll look into it.

haha alright, I won’t try that.

I was finishing up this project and decided it was the best time to add 2 separate custom fonts but instead it just provided me with a headache. I’m sure there is a simple fix but I just can’t hack it on my own right now… will be much appreciated.

Just replace /static/fonts/ by /fonts/ and it works.

1 Like

Ah Tom, thank you so much for taking the time - works perfectly now, so simple !

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