Skip to content

Commit 81f28ce

Browse files
fix(favicon): add favicon configuration for GitHub Pages deployments
1 parent 18faeab commit 81f28ce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nuxt.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
// https://nuxt.com/docs/api/configuration/nuxt-config
33
export default defineNuxtConfig({
44

5+
app: {
6+
head: {
7+
title: "My Page Title",
8+
link: [
9+
// https://nuxt.com/deploy/github-pages and https://vite.dev/guide/env-and-mode.html for details.
10+
// !!! Make use of compile time environment var NUXT_APP_BASE_URL to work for GitHub Pages deployments as well.
11+
// Assumption: favicon files in ~/public as ~/public/favicon.ico, ~/public/favicon-32x32.png etc.:
12+
{
13+
rel: "icon",
14+
type: "image/x-icon",
15+
href: (import.meta.env.NUXT_APP_BASE_URL ? import.meta.env.NUXT_APP_BASE_URL : "/") + "favicon.ico"
16+
}
17+
// ... add probable other icon variants accordingly
18+
],
19+
},
20+
},
21+
22+
523
modules: [
624
'@nuxt/ui',
725
'@nuxt/eslint',

0 commit comments

Comments
 (0)