Files
andwati.com/src/lib/og.tsx
T
andwati ec6401ac38 Replace Astro/Strapi site with Next.js static export
- Fresh structure: Next.js App Router + Tailwind v4 at the repo root, exported
  as static files (output: export) and served by static-web-server
- Remove the Strapi CMS, Astro app, Pagefind search, comments, old scripts,
  Lighthouse config and compose files; content in content/ is now plain
  markdown with YAML frontmatter
- Pages: About, Writing, Reading (3D bookshelf) and Portfolio, styled after
  adammaj.com
- SEO: metadata and canonicals, JSON-LD, generated OG images, sitemap, robots,
  RSS and JSON feeds, llms.txt
- Umami via PUBLIC_UMAMI_SCRIPT_URL / PUBLIC_UMAMI_WEBSITE_ID (build args)
- Dockerfile builds the export and serves it with sws.toml (security headers,
  clean URLs, .well-known, OG image content type, immutable asset caching)
- Prettier and cspell for content with a husky/lint-staged pre-commit hook
- Old redirect list dropped to start from a clean slate
2026-09-30 12:48:14 +03:00

57 lines
1.3 KiB
TypeScript

import { ImageResponse } from "next/og";
import { site } from "@/lib/site";
export const ogSize = { width: 1200, height: 630 };
export const ogContentType = "image/png";
/** 1200x630 social card: title on white, name and domain along the bottom. */
export function ogImage(title: string, kicker?: string) {
return new ImageResponse(
<div
style={{
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
background: "#ffffff",
color: "#1a202c",
padding: "72px 80px",
borderLeft: "16px solid #2b6cb0",
}}
>
<div
style={{
fontSize: 30,
color: "#718096",
textTransform: "uppercase",
letterSpacing: 3,
}}
>
{kicker ?? ""}
</div>
<div
style={{
fontSize: title.length > 60 ? 56 : 72,
fontWeight: 700,
lineHeight: 1.15,
display: "flex",
}}
>
{title}
</div>
<div
style={{
display: "flex",
justifyContent: "space-between",
fontSize: 30,
}}
>
<span style={{ color: "#1a202c" }}>{site.name}</span>
<span style={{ color: "#718096" }}>andwati.com</span>
</div>
</div>,
ogSize,
);
}