Skip to content
Myr

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 file

Take it

Fold every page's project events once, keep Markdown off the first load, and cache what never changesoscabrielbefore adoption38e5215

lines 1–3why, one step back
1import { Brand } from "@repo/brand";
23export const pageTitle = (title: string) => `${title} · ${Brand.name}`;

Put every page in the Control room shell: rail, bars, workspace, router links, keys, head, error and pending statesoscabrielbefore adoptionddbd51e

lines 4–5why, one step back
4
5/**

Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72

lines 6–7why, one step back
6 * The router keeps one meta per name or Open Graph property, the last a route
7 * gives, so a page's replace the root's.

Put every page in the Control room shell: rail, bars, workspace, router links, keys, head, error and pending statesoscabrielbefore adoptionddbd51e

lines 8–29why, one step back
8 */
9export const pageHead = ({10 description,11 title,12 type = "website",13}: {14 readonly description?: string;15 readonly title: string;16 readonly type?: "article" | "website";17}) => ({18 meta: [19 { title: pageTitle(title) },20 { content: title, property: "og:title" },21 { content: type, property: "og:type" },22 ...(description === undefined23 ? []24 : [25 { content: description, name: "description" },26 { content: description, property: "og:description" },27 ]),28 ],29});