Skip to content

Commit f9c969c

Browse files
committed
fix: favicon
Signed-off-by: Innei <[email protected]>
1 parent 912f47b commit f9c969c

File tree

5 files changed

+59
-15
lines changed

5 files changed

+59
-15
lines changed

public/innei-dark.svg

Lines changed: 40 additions & 0 deletions
Loading

public/innei.svg

Lines changed: 2 additions & 13 deletions
Loading

src/app.config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
"scripts": []
7575
},
7676
"site": {
77-
"favicon": "/innei.svg"
77+
"favicon": "/innei.svg",
78+
"faviconDark": "/innei-dark.svg"
7879
},
7980
"hero": {
8081
"title": {
@@ -129,4 +130,4 @@
129130
}
130131
}
131132
}
132-
}
133+
}

src/app/config.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface Custom {
4949

5050
export interface Site {
5151
favicon: string
52+
faviconDark?: string
5253
}
5354
export interface Hero {
5455
title: Title

src/app/layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ export const generateMetadata = async () => {
5858
type: 'image/svg+xml',
5959
sizes: 'any',
6060
},
61+
{
62+
rel: 'icon',
63+
type: 'image/svg+xml',
64+
url: config.site.favicon,
65+
media: '(prefers-color-scheme: light)',
66+
},
67+
{
68+
rel: 'icon',
69+
type: 'image/svg+xml',
70+
url: config.site.faviconDark || config.site.favicon,
71+
72+
media: '(prefers-color-scheme: dark)',
73+
},
6174
],
6275

6376
themeColor: [

0 commit comments

Comments
 (0)