Custom Fonts Not Uploading to SXA Theme

When you create a custom theme with the SXA CLI, not only can you upload css and javascript (optimized or not, depending on your config selections), but you can also upload other assets like images or even custom fonts.

The Problem

With my current project (it started on 9.3 and continues on 10.1), we are indeed using custom fonts. However, when I would use the sxa upload command, I found that, while almost everything would upload to the theme in the media library, the font files would not.

TL;DR; (…really?)

Thanks to Mark Cassidy for this, but the fix really is pretty simple. The problem is that the fonts directory of your local theme just isn’t anywhere in the config to be watched or uploaded. So, open up the gulp/config.js and add 'fonts/**/*.*' to one of the sections. I chose the img: section.

That’s all with this one!

Happy Sitecore trails, my friend!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: