mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:15:31 -04:00
5a1636baa3
- Replace Biome with oxlint + oxfmt (OXC toolchain) for linting and formatting - Add .oxlintrc.json and .oxfmtrc.json configuration files - Update VS Code settings and devcontainer to use oxc-vscode extension - Remove contact form, Resend email integration, and related server action/schema - Remove unused UI components (accordion, alert, card, tabs, toggle, etc.)
76 lines
1.8 KiB
TypeScript
76 lines
1.8 KiB
TypeScript
import type { Metadata } from "next";
|
||
|
||
import authorConfig from "@/lib/config/author";
|
||
import siteConfig from "@/lib/config/site";
|
||
|
||
export const defaultMetadata: Metadata = {
|
||
metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL!),
|
||
title: {
|
||
template: `%s – ${siteConfig.name}`,
|
||
default: `${siteConfig.name} – ${siteConfig.tagline}`,
|
||
},
|
||
description: siteConfig.description,
|
||
openGraph: {
|
||
siteName: siteConfig.name,
|
||
title: {
|
||
template: "%s",
|
||
default: `${siteConfig.name} – ${siteConfig.tagline}`,
|
||
},
|
||
url: "/",
|
||
locale: process.env.NEXT_PUBLIC_SITE_LOCALE?.replace("-", "_"),
|
||
type: "website",
|
||
},
|
||
twitter: {
|
||
creator: `@${authorConfig.social?.twitter}`,
|
||
},
|
||
alternates: {
|
||
canonical: "/",
|
||
types: {
|
||
"application/rss+xml": [
|
||
{
|
||
title: `${siteConfig.name} (RSS)`,
|
||
url: "/feed.xml",
|
||
},
|
||
],
|
||
"application/atom+xml": [
|
||
{
|
||
title: `${siteConfig.name} (Atom)`,
|
||
url: "/feed.atom",
|
||
},
|
||
],
|
||
},
|
||
},
|
||
other: {
|
||
humans: "/humans.txt",
|
||
},
|
||
};
|
||
|
||
/**
|
||
* Helper function to deep merge a page's metadata into the default site metadata
|
||
* @see https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
||
*/
|
||
export const createMetadata = (metadata: Metadata & { canonical: string }): Metadata => ({
|
||
...defaultMetadata,
|
||
...metadata,
|
||
openGraph: {
|
||
...defaultMetadata.openGraph,
|
||
title: metadata.title!,
|
||
description: metadata.description!,
|
||
url: metadata.canonical,
|
||
...metadata.openGraph,
|
||
},
|
||
twitter: {
|
||
...defaultMetadata.twitter,
|
||
...metadata.twitter,
|
||
},
|
||
alternates: {
|
||
...defaultMetadata.alternates,
|
||
canonical: metadata.canonical,
|
||
...metadata.alternates,
|
||
},
|
||
other: {
|
||
...defaultMetadata.other,
|
||
...metadata.other,
|
||
},
|
||
});
|