mitydigital/statamic-google-fonts
A Statamic addon for managing Google Fonts: configure font families and weights, download and self-host files locally, and generate the CSS you need—avoiding external Google requests for better privacy and performance.
composer require mitydigital/statamic-google-fonts. Statamic's addon discovery registers the service provider automatically; only add it manually if you've disabled discovery.php artisan vendor:publish --provider="MityDigital\StatamicGoogleFonts\ServiceProvider" (or pick the package's tag from the vendor:publish menu).config/statamic-google-fonts.php and at the Google Fonts utility in the Statamic CP (under Tools or Content, depending on your Statamic version). The utility is where editors pick families, weights, styles and subsets.Inter), tick the weights you need (400/600/700), save, then drop the tag into your layout <head>:{{ google_fonts }}
That renders the <link rel="preconnect"> and stylesheet <link> tags for every configured family. Put it once in your base layout (resources/views/layout.antlers.html or your Blade layout) before your own CSS so the cascade order is correct.
{!! Statamic::tag('google_fonts') !!} (or the package's Blade directive/component, if provided — check the README). The tag returns HTML, so it must be rendered unescaped.<link> yourself (media queries, onload swapping), check src/Tags/ for a URL-only handle such as {{ google_fonts:url }} before hand-rolling the output.config/statamic-google-fonts.php behind env() guards.latin, latin-ext, …) to avoid a bloated CSS payload.media queries, font-display tweaks, or async loading patterns.{{ google_fonts }} through a modifier (or use Blade's {{ }}) — the tag must render raw or you'll see escaped <link> markup.php artisan view:clear after changing configured families or weights, otherwise stale <link> tags can persist.php artisan cache:clear (or the package's own command) forces a refresh.src/Tags/. Dump the raw tag output to separate a config problem from a rendering problem.How can I help you explore Laravel packages today?