Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Binary file added static/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions static/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions tests/favicons.test.mjs
Original file line number Diff line number Diff line change
@@ -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(/<head[^>]*>([\s\S]*?)<\/head>/i)?.[1] ?? '';
}

test('the home page links the favicons supplied in static/', (t) => {
const h = head(home);
assert.match(
h,
/<link rel="icon" href="\/favicon\.ico" sizes="16x16 32x32 48x48" \/>/,
'links favicon.ico',
);
assert.match(
h,
/<link rel="icon" href="\/favicon\.svg" type="image\/svg\+xml" \/>/,
'links favicon.svg',
);
assert.match(
h,
/<link rel="apple-touch-icon" href="\/apple-touch-icon\.png" \/>/,
'links apple-touch-icon.png',
);
t.diagnostic('all three discovered favicon links present');
});