Repository navigation
Serve Both Sites' Fonts From the Sites Themselves - #531
Conversation
Lexend on the blog, and Cormorant Garamond and EB Garamond on the family site, now load from each site's own fonts/ tree instead of Google Fonts. Each family ships its Latin and Latin Extended woff2 subsets with its OFL.txt, declared with Google Fonts' unicode ranges. Both policies drop the Google hosts, and the font files join the one-hour cache class. Part of #529. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Prose Gate Co-Authored-By: Claude Opus 5.5 <[email protected]>
Caddy's path matcher does not expand a wildcard in the middle of a path, so /fonts/*.woff2 matched nothing and the fonts answered no-cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The italic files are static instances, so the soil labels' italic 600 is synthesized, as it was under Google Fonts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #531 +/- ##
==========================================
Coverage ? 52.39%
==========================================
Files ? 12
Lines ? 3336
Branches ? 0
==========================================
Hits ? 1748
Misses ? 1588
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The cross-site font, CSP, caching, and deployment changes warrant final human review.
No open issues 🎉
What changed in this PR
This pull request self-hosts the web fonts for the blog and family site, removing Google Fonts requests while updating CSP policies, caching, licensing, and repository tooling.
Changes:
- Adds local Lexend, Cormorant Garamond, and EB Garamond font assets with OFL licenses.
- Replaces Google Fonts links with local font declarations and a Lexend preload.
- Updates security headers, Caddy caching, documentation, and binary/license exclusions.
| File | Description |
|---|---|
themes/README.md |
Documents the local font preload customization. |
static/fonts/lexend/OFL.txt |
Adds the Lexend license. |
sites/viljoen.family/site.css |
Declares local Cormorant Garamond and EB Garamond faces. |
sites/viljoen.family/README.md |
Documents locally served family-site fonts and licensing. |
sites/viljoen.family/index.html |
Removes Google Fonts resources from the English page. |
sites/viljoen.family/fonts/eb-garamond/OFL.txt |
Adds the EB Garamond license. |
sites/viljoen.family/fonts/cormorant-garamond/OFL.txt |
Adds the Cormorant Garamond license. |
sites/viljoen.family/af/index.html |
Removes Google Fonts resources from the Afrikaans page. |
layouts/_partials/extend_head.html |
Preloads the blog’s local Lexend font. |
deploy/README.md |
Documents font caching and local-font CSP behavior. |
deploy/Caddyfile |
Updates CSP headers and font cache handling. |
cspell.json |
Excludes carried font licenses from spelling checks. |
checks/security-headers.txt |
Synchronizes expected security headers with the deployment configuration. |
assets/css/extended/custom.css |
Declares the local Lexend font subsets. |
.github/prose-gate-excludes |
Excludes verbatim font licenses from prose checks. |
.gitattributes |
Marks WOFF2 assets as binary. |
.editorconfig-checker.json |
Excludes WOFF2 assets from formatting checks. |
Review effort: Lite
|
Answering the review headline on 0271eb7, "needs a closer look" with no counted finding. The headline names areas rather than a defect, and each was exercised on the local staging mirror before this pull request opened, as the Verification section records:
Coverage. The review's file table names 17 of the 27 changed files. The 10 it leaves out are the The maintainer's merge of the promotion stays the human review the headline asks for. |
Summary
Both sites now serve their web fonts themselves rather than from Google Fonts, which is step 1 of #529. Each page view no longer sends the reader's address and referrer to Google, and neither policy names another host for styles or fonts.
static/fonts/lexend/.assets/css/extended/custom.cssdeclares it, andlayouts/_partials/extend_head.htmlnow preloads the Latin file instead of linking the Google stylesheet.sites/viljoen.family/fonts/.site.cssdeclares them, and both pages drop the Googlepreconnectand stylesheet links.@font-facerules carry Google's unicode ranges, so a page fetches only the subsets its text uses. Each family'sOFL.txtis beside its files, as the SIL Open Font License requires. The weights and styles declared are the ones the Google URLs requested, so rendering is unchanged, the family site's italic 600 still synthesized from italic 500 included.style-src 'self' 'unsafe-inline'; font-src 'self'. The family policy does the same and drops the two Googleconnect-srchosts.deploy/Caddyfileandchecks/security-headers.txtchange together./fonts/on the blog and*.woff2on the family site.deploy/README.md"Cache lifetimes" says so.*.woff2isbinaryin.gitattributesand excluded from editorconfig-checker. The license texts are excluded from the prose gate and from cspell, since they are carried verbatim.The
commentslabel covers three edited comments: thecustom.cssheader, the Caddyfile's media-class comment, and the new prose-gate exclusion entry. Each would otherwise describe the old setup or leave the exclusion unexplained.Part of #529. Its step 2, the build gate that fails on any off-site subresource, is a separate pull request.
Verification
Run on server-2 in a worktree holding this branch:
deploy/make-release.shagainst the local staging mirror. The URL contract passes, all 1157 local asset references resolve, the orphan count holds at 99, and the CSP script gate passes.checks/check-live-urls.sh:PASS - 1296 URLs honored, with every response carrying the new policies exactly.checks/check-csp-browser.pyagainst the blog:PASS - 328 pages loaded with no violation the allow list lacks.--urlsnaming the family pages/en/and/af/against the family mirror: neither reported a violation. Its only failures were for/search/, which the check always adds and the family site does not have.woff2answered200,font/woff2, andpublic, max-age=3600, and pages keptno-cache. The first run showed the blog's font atno-cache, because Caddy'spathmatcher does not expand a wildcard mid-path, so/fonts/*.woff2matched nothing. 4f3a9c7 widened it to/fonts/*.🤖 Generated with Claude Code