head.ts
This file
Path
apps/web/src/features/shared/head.ts
29 lines · 756 bytes · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
123456789101112131415161718192021222324252627282930import { Brand } from "@repo/brand";
export const pageTitle = (title: string) => `${title} · ${Brand.name}`;
/** * The router keeps one meta per name or Open Graph property, the last a route * gives, so a page's replace the root's. */export const pageHead = ({ description, title, type = "website",}: { readonly description?: string; readonly title: string; readonly type?: "article" | "website";}) => ({ meta: [ { title: pageTitle(title) }, { content: title, property: "og:title" }, { content: type, property: "og:type" }, ...(description === undefined ? [] : [ { content: description, name: "description" }, { content: description, property: "og:description" }, ]), ],});