From f960205d21dcb20272dea9c206438e2f7417ae34 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Wed, 2 Oct 2024 13:57:15 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=A0=20Support=20favicon=20in=20static?= =?UTF-8?q?=20builds=20(#483)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/jupyter-book/mystmd/issues/1449 --- .changeset/new-pens-thank.md | 6 ++++++ themes/article/app/root.tsx | 5 ++++- themes/book/app/root.tsx | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changeset/new-pens-thank.md 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 },