/** @jsxRuntime automatic */ /** @jsxImportSource remix/component */ import { unsafeHTML } from 'remix/component' import type { Action } from 'remix/router' import { markdownToText, renderMarkdown } from '../../src/domain/markdown.ts' import { canonicalUrl, loadSite } from '../data/site.ts' import { routes } from '../routes.ts' import { contactLinks } from '../ui/contact-links.tsx' import { icon } from '../ui/icons.tsx' import { ogImage } from '../ui/og-image.ts' import { picture } from '../ui/picture.tsx' import { render } from '../ui/render.tsx' function initials(name: string) { const letters = name .split(/\s+/) .filter(Boolean) .map((word) => word[0]!.toUpperCase()) return letters.length > 1 ? letters[0]! + letters[letters.length - 1]! : (letters[0] ?? 'ยท') } export default { async handler(context) { const site = await loadSite(context) const { config } = site.content return render( site, { title: 'About', description: markdownToText(config.bio, 160), canonical: canonicalUrl(site, routes.about.href()), nav: 'about', ...ogImage(site, config.headshot), },
{config.headshot ? ( picture(site, config.headshot, { sizes: '(max-width: 760px) 70vw, 360px', priority: true, class: 'headshot', }) ) : ( )}

{config.photographerName}

{config.location ?

{config.location}

: null} {/* renderMarkdown escapes all text and only emits a fixed set of tags and safe links. */}

{icon('mail')} Get in touch

{contactLinks(config)}
, ) }, } satisfies Action