diff --git a/go.mod b/go.mod index 2e99b518bd..673eaf706b 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/google/docsy-example go 1.12 -require github.com/google/docsy/theme v0.0.0-20260612162003-f22a352d4262 // indirect +require github.com/google/docsy/theme v0.0.0-20260614124843-f516706840c3 // indirect diff --git a/go.sum b/go.sum index 890e9219d4..6ec45ab704 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3 h1:/iluJkJiyTAdnqrw3Yi9rH2HNHhrrtCmj8VJe7I6o3w= github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/google/docsy/theme v0.0.0-20260612162003-f22a352d4262 h1:DGXSMc4p24g6M1S4cQ43pRdHfUGdlMRjlraSijTABcw= -github.com/google/docsy/theme v0.0.0-20260612162003-f22a352d4262/go.mod h1:CGCFFJjc3PAYexPDsQqTbB3/lWnncwlwKLnSQkDaaF0= +github.com/google/docsy/theme v0.0.0-20260614124843-f516706840c3 h1:5iDfW1iwC8gZ3caayHWOyukUG4C7MLb1aL1l+vBP2yc= +github.com/google/docsy/theme v0.0.0-20260614124843-f516706840c3/go.mod h1:CGCFFJjc3PAYexPDsQqTbB3/lWnncwlwKLnSQkDaaF0= github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o= github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/static/apple-touch-icon.png b/static/apple-touch-icon.png new file mode 100644 index 0000000000..4f4f9da212 Binary files /dev/null and b/static/apple-touch-icon.png differ diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000..8a714844c6 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000000..f00e958264 --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/tests/favicons.test.mjs b/tests/favicons.test.mjs new file mode 100644 index 0000000000..9ed06d07a7 --- /dev/null +++ b/tests/favicons.test.mjs @@ -0,0 +1,38 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; + +// Verifies that the Docsy theme's default favicons partial discovers and links +// the icon files this site ships in `static/`. Assumes the site has been built +// (`npm run build`); in the `test-only` chain, the check:links prebuild takes +// care of that. + +const home = readFileSync( + fileURLToPath(new URL('../public/index.html', import.meta.url)), + 'utf8', +); + +function head(html) { + return html.match(/]*>([\s\S]*?)<\/head>/i)?.[1] ?? ''; +} + +test('the home page links the favicons supplied in static/', (t) => { + const h = head(home); + assert.match( + h, + //, + 'links favicon.ico', + ); + assert.match( + h, + //, + 'links favicon.svg', + ); + assert.match( + h, + //, + 'links apple-touch-icon.png', + ); + t.diagnostic('all three discovered favicon links present'); +});