Fonts
Self-hosted web fonts, chosen by name in the site config.
Use
The addon ships a library of variable woff2 files, served from your own server. Name the families a site loads in its config:
{
"addons": {
"phlat/fonts": {
"families": ["Inter", "JetBrains Mono"]
}
}
}
Then include the partial in your layout <head>:
{include '@fonts/fonts.latte'}
It emits a preload link and an @font-face rule with font-display: swap for each family you named, and nothing for a family that is not in the library. The font stack itself (font-family) stays in your own CSS.
The library
The fonts page holds the files and a families map from name to file and weight range, so adding a font is adding a woff2 to that page and a line to the map. Each file is a managed page file, so it is served through the normal page-file path.