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
3 changes: 2 additions & 1 deletion app/[product]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import FooterServer from "@comps/shared/FooterServer";
import { Inter } from "next/font/google";
import Script from "next/script";
import NavBarServer from "../../components/shared/NavBarServer";
import { withAssetVersion } from "../../utils/assetVersion";
import { getGoogleTagId } from "../../utils/getGoogleTagId";
import { getLocale } from "../../utils/i18n";
import "../globals.css";
Expand All @@ -28,7 +29,7 @@ export default async function RootLayout({
return (
<html lang={htmlLang}>
<head>
<link rel="icon" href={`/favicons/${product}.ico`} />
<link rel="icon" href={withAssetVersion(`/favicons/${product}.ico`)} />

{product === "YakShaver" && (
<Script
Expand Down
3 changes: 2 additions & 1 deletion components/shared/NavBarServer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NavGroup } from "@/types/nav-group";
import { NavigationBarLeftNavItemStringItem as NavItem } from "@tina/__generated__/types";
import { withAssetVersion } from "@utils/assetVersion";
import { getNavigationBarWithFallback } from "@utils/i18n";
import NavBarClient from "./NavBarClient";

Expand Down Expand Up @@ -70,7 +71,7 @@ export default async function NavBarServer({ product, locale }: NavBarServerProp

const bannerImage =
normalizedImgSrc && imgHeight && imgWidth
? { imgHeight, imgSrc: normalizedImgSrc, imgWidth }
? { imgHeight, imgSrc: withAssetVersion(normalizedImgSrc), imgWidth }
: undefined;
return (
<NavBarClient
Expand Down
Binary file modified public/favicons/Tiger.ico
Binary file not shown.
Binary file removed public/favicons/tiger.ico
Binary file not shown.
9 changes: 9 additions & 0 deletions utils/assetVersion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const ASSET_VERSION =
process.env.VERCEL_GIT_COMMIT_SHA?.slice(0, 8) ??
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA?.slice(0, 8);

export function withAssetVersion(src: string): string {
if (!ASSET_VERSION || !src.startsWith("/")) return src;
const separator = src.includes("?") ? "&" : "?";
return `${src}${separator}v=${ASSET_VERSION}`;
}
Loading