astro-template/src/components/BaseHead.astro
Nicholai d10198a3b6 refactor: simplify Astro template to minimal components
- Remove elaborate UI components (CustomCursor, SearchDialog, GridOverlay, ThemeToggle, ThemePreferenceDialog, Navigation, Footer, section components, blog components)
- Strip portfolio and section content
- Reduce global.css to basic typography and prose
- Simplify BaseHead and BlogCard components
- Update content config to only blog collection
- Update README and CLAUDE.md with minimal guidance
- Adjust routes to basic pages (index, blog, contact, 404)
- Delete unused files (dev/injection.md, dev/open-source-vfx-pipeline.mdx, etc.)
2025-12-27 05:22:01 -07:00

55 lines
1.5 KiB
Plaintext

---
import '../styles/global.css';
import type { ImageMetadata } from 'astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
interface Props {
title: string;
description: string;
image?: ImageMetadata;
type?: 'website' | 'article';
publishedTime?: Date;
modifiedTime?: Date;
}
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const {
title,
description,
image,
type = 'website',
publishedTime,
modifiedTime,
} = Astro.props;
---
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content={Astro.generator} />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="canonical" href={canonicalURL} />
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
{image && (
<>
<meta property="og:image" content={new URL(image.src, Astro.url)} />
<meta name="twitter:image" content={new URL(image.src, Astro.url).toString()} />
</>
)}
<meta property="og:type" content={type} />
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
{publishedTime && <meta property="article:published_time" content={publishedTime.toISOString()} />}
{modifiedTime && <meta property="article:modified_time" content={modifiedTime.toISOString()} />}