diff --git a/public/favicon.ico b/public/favicon.ico index 718d6fe..ff1bcd9 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/lib/format.ts b/src/lib/format.ts new file mode 100644 index 0000000..158372d --- /dev/null +++ b/src/lib/format.ts @@ -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()}`; +} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index d39996f..4c97153 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -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}`; +} diff --git a/src/pages/[quadrant]/index.tsx b/src/pages/[quadrant]/index.tsx index deea09a..3710118 100644 --- a/src/pages/[quadrant]/index.tsx +++ b/src/pages/[quadrant]/index.tsx @@ -2,15 +2,20 @@ import Head from "next/head"; import { useRouter } from "next/router"; import { getQuadrant, getQuadrants } from "@/lib/data"; +import { formatTitle } from "@/lib/format"; import { CustomPage } from "@/pages/_app"; const QuadrantPage: CustomPage = () => { const { query } = useRouter(); const quadrant = getQuadrant(query.quadrant as string); + + if (!quadrant) return null; + return ( <>
-= NextPage
& {
@@ -14,8 +17,15 @@ type CustomAppProps = AppProps & {
export default function App({ Component, pageProps, router }: CustomAppProps) {
return (
-