feat: add seo title and favicon respecting basePath

This commit is contained in:
Mathias Schopmans
2024-02-13 11:44:03 +01:00
committed by Mathias Schopmans
parent 57d7e85331
commit 554607a58d
7 changed files with 36 additions and 21 deletions

7
src/lib/format.ts Normal file
View File

@@ -0,0 +1,7 @@
// Format the title of the page
import { getAppName } from "@/lib/data";
export function formatTitle(title: string = ""): string {
if (!title) return getAppName();
return `${title} | ${getAppName()}`;
}

View File

@@ -1,5 +1,12 @@
import { type ClassValue, clsx } from "clsx";
import config from "../../next.config.mjs";
export function cn(...inputs: ClassValue[]) {
return clsx(inputs);
}
export function assetUrl(path: string) {
if (!config.basePath) return path;
return `${config.basePath}${path}`;
}