/** * About page — Bauhaus / Leica minimalist layout. * Reads content from content/about.md (frontmatter + markdown body). */ import { readFileSync } from 'fs'; import { join } from 'path'; import yaml from 'js-yaml'; import Image from 'next/image'; import { imageUrl, assetPlaceholder } from '@/lib/urls'; import { immich } from '@/lib/immich'; import './about.css'; export const dynamic = 'force-dynamic'; interface AboutFrontmatter { portrait?: string; name?: string; location?: string; gear?: string[]; } function getAboutContent() { const filePath = join(process.cwd(), 'content', 'about.md'); if (!require('fs').existsSync(filePath)) { return { meta: {} as AboutFrontmatter, body: '' }; } const raw = readFileSync(filePath, 'utf-8'); let meta = {} as AboutFrontmatter; let body = raw; const match = raw.match(/^(?:---\r?\n)([\s\S]*?)(?:\r?\n---\r?\n)([\s\S]*)$/); if (match) { try { meta = (yaml.load(match[1]) || {}) as AboutFrontmatter; } catch (e) { console.error('Failed to parse about.md frontmatter', e); } body = match[2]; } return { meta, body: body.trim() }; } export default async function AboutPage() { const { meta, body } = getAboutContent(); // Fetch ThumbHash for portrait placeholder const portraitAsset = meta.portrait ? await immich.getAssetInfo(meta.portrait) : null; const portraitPlaceholder = portraitAsset ? assetPlaceholder(portraitAsset) : null; return (
{meta.location}
}{line}
))}