feat: site font preloads (theme schema + SPA injection)#40
Draft
BatLeDev wants to merge 2 commits into
Draft
Conversation
a105cbe to
cbbc68a
Compare
- add `bodyFontPreloadUrls` / `headingFontPreloadUrls` to the theme schema and the self-hosted Nunito default to defaultTheme. - inject `<link rel="preload">` font links into the served SPA html from the sites _hashes payload, with an optional (extension-derived) mime type.
Drop the "détaillées … en mode avancé" phrasing in favour of the shorter "couleurs avancées définies manuellement", in all six locales.
cbbc68a to
6627681
Compare
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two parts of the site-font-preload feature:
bodyFontPreloadUrls/headingFontPreloadUrls(string arrays,layout: 'none') to the theme schema, plus the self-hosted Nunito default indefaultTheme. These declare which font files a theme wants preloaded.serve-spa) — inject<link rel="preload" as="font">into served SPAindex.htmlfrom thefontslist returned by simple-directory's/sites/_hashes, spliced before the_theme.csslink, so fonts download in parallel with the theme. Interpolated attribute values are HTML-escaped (thehreforiginates from site-configured theme data).Why: break the serial HTML →
_theme.css→ woff2 chain by preloading fonts in parallel. Producer side: data-fair/simple-directory#128.Regression risks:
defaultThemegainsbodyFontPreloadUrls(Nunito); additive, only read by the preload logic.privateDirectoryUrlis set and SD returnsfonts; tolerates absence (?? []), so no change against an older simple-directory, and a no-op whenindex.htmlhas no_theme.csslink.Note — unrelated commit: this branch also carries
fix(lib-common-types): simplify the assistedMode reset warning wording(i18n text only, six locales). It's independent of the font feature — split into its own PR if you'd rather keep this one single-purpose.