hupe1980 / gatsby-plugin-webfonts

A Gatsby plugin to handle cdn, base64 and self hosted webfonts
MIT License
55 stars 0 forks source link

selfHosted generating double slashes in URL #8

Closed daniyals14 closed 4 years ago

daniyals14 commented 4 years ago

Hello,

When i try to use the selfHosted option, the URL generated is incorrect and has double slashed in the URL like this

static/webfonts//s/lato/v16/S6uyw4BMUTPHjx4wXg.woff2

I am also using assetPrefix option on compile, works fine when this is disabled

daniyals14 commented 4 years ago

If i make the following change, it works fine, in utils.js

return${pathPrefix || `}/static/webfonts${pathname};`

daniyals14 commented 4 years ago

@hupe1980 Ive created a PR, can u pls look into it?

hupe1980 commented 4 years ago

9 was merged. Thx!