diff --git a/.changeset/new-pens-thank.md b/.changeset/new-pens-thank.md new file mode 100644 index 00000000..c7e2c5f2 --- /dev/null +++ b/.changeset/new-pens-thank.md @@ -0,0 +1,6 @@ +--- +'@myst-theme/article': patch +'@myst-theme/book': patch +--- + +Support favicon in static builds diff --git a/themes/article/app/root.tsx b/themes/article/app/root.tsx index 8e123687..fe0a38d0 100644 --- a/themes/article/app/root.tsx +++ b/themes/article/app/root.tsx @@ -26,7 +26,10 @@ export const links: LinksFunction = () => { return [ { rel: 'icon', - href: '/favicon.ico', + href: + process.env.MODE === 'static' + ? `${process.env.BASE_URL || ''}/favicon.ico` + : '/favicon.ico', }, { rel: 'stylesheet', href: tailwind }, { rel: 'stylesheet', href: thebeCoreCss }, diff --git a/themes/book/app/root.tsx b/themes/book/app/root.tsx index f68869a5..66a6354f 100644 --- a/themes/book/app/root.tsx +++ b/themes/book/app/root.tsx @@ -31,7 +31,10 @@ export const links: LinksFunction = () => { return [ { rel: 'icon', - href: '/favicon.ico', + href: + process.env.MODE === 'static' + ? `${process.env.BASE_URL || ''}/favicon.ico` + : '/favicon.ico', }, { rel: 'stylesheet', href: tailwind }, { rel: 'stylesheet', href: thebeCoreCss },