1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00
Files
jarv.is/lib/metadata.ts
T
jake 5a1636baa3 refactor: migrate from Biome to oxlint/oxfmt, remove contact form
- 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.)
2026-04-05 19:45:18 -04:00

76 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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,
},
});