Skip to content

Instantly share code, notes, and snippets.

View derpyherp's full-sized avatar

derpyherp

View GitHub Profile
@candidexmedia
candidexmedia / Publii-Google-Fonts-Self-Hosted.md
Last active December 22, 2023 03:33
Self-Host Google Fonts to Publii

(Code Snippets for: https://forum.getpublii.com/topic/where-should-the-font-files-be-put-if-self-host-google-fonts/#post-7040)

Update: it is now easier than ever to add custom fonts in Publii. See: How to Add a Custom Font (Publii Docs). You can still use the Google Webfonts Helper to download the woff2 files (or download directly from the Google Fonts, or the Font Foundry)

In terms of where to put the fonts: that's up to you. I've shared what I've done for my sites below.

In terms of referring: I would just use the Google Webfonts Helper to go faster: https://gwfh.mranftl.com/fonts. Just indicate which fonts you want, which weights, charset, where the files are located, etc. and it will format the code that you need to add at the top of your main.css file. This code will include the src.