Added font preload links to the Page+Defaults extension in the Website library target.

This commit is contained in:
2026-08-25 17:05:08 +02:00
parent 7aee1cd949
commit c09ac657ab
3 changed files with 48 additions and 2 deletions
@@ -32,6 +32,13 @@ struct IndexPageTests {
#expect(html.contains("/js/index.js"))
}
@Test
func `renders no font preloads until fonts are declared`() {
// The template ships no fonts, so a preload link here would point at a file the service does not serve.
#expect(IndexPage.preloadedFonts.isEmpty)
#expect(!IndexPage(locale: .init(identifier: "en")).render().contains(#"rel="preload""#))
}
@Test
func `renders versioned asset URLs when given a version`() {
let html = IndexPage(