mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 21:58:31 +00:00
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
---
|
|
import { SITE, OPEN_GRAPH, type Frontmatter } from '../config';
|
|
|
|
export interface Props {
|
|
frontmatter: Frontmatter;
|
|
canonicalUrl: URL;
|
|
}
|
|
|
|
const { frontmatter, canonicalUrl } = Astro.props as Props;
|
|
const formattedContentTitle = `${frontmatter.title} 🚀 ${SITE.title}`;
|
|
const imageSrc = frontmatter.image?.src ?? OPEN_GRAPH.image.src;
|
|
const canonicalImageSrc = new URL(imageSrc, Astro.site);
|
|
const imageAlt = frontmatter.image?.alt ?? OPEN_GRAPH.image.alt;
|
|
---
|
|
|
|
<!-- Page Metadata -->
|
|
<link rel="canonical" href={canonicalUrl} />
|
|
|
|
<!-- OpenGraph Tags -->
|
|
<meta property="og:title" content={formattedContentTitle} />
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:url" content={canonicalUrl} />
|
|
<meta property="og:locale" content={frontmatter.ogLocale ?? SITE.defaultLanguage} />
|
|
<meta property="og:image" content={canonicalImageSrc} />
|
|
<meta property="og:image:alt" content={imageAlt} />
|
|
<meta name="description" property="og:description" content={frontmatter.description ?? SITE.description} />
|
|
<meta property="og:site_name" content={SITE.title} />
|