bgenc.net/src/routes/[slug]/+page.svelte
Kaan Barmore-Genç 0f6a60bec9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Set some post images
2024-05-11 00:30:08 -05:00

59 lines
1.7 KiB
Svelte

<script lang="ts">
import { format, formatISO } from 'date-fns';
import Jpeg from '../profile.avif?format=jpeg';
export let data;
</script>
<svelte:head>
<title>{data.title} - Kaan Barmore-Genç</title>
<meta property="og:title" content={`${data.title} - Kaan Barmore-Genç`} />
<meta property="og:type" content="article" />
<meta property="article:author" content="https://bgenc.net" />
<meta property="og:url" content={`https://bgenc.net/${data.slug}/`} />
<meta property="article:published_time" content={formatISO(new Date(data.date))} />
{#if data.updated}
<meta property="article:modified_time" content={formatISO(new Date(data.updated))} />
{/if}
{#if data.image}
<meta
property="og:image"
content={data.image.startsWith('https://') ? data.image : `https://bgenc.net${data.image}`}
/>
{:else}
<meta property="og:image" content={`https://bgenc.net${Jpeg}`} />
{/if}
{#if data.description}
<meta name="description" content={data.description} />
<meta property="og:description" content={data.description} />
{/if}
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="Kaan Barmore-Genç's Site" />
</svelte:head>
<article data-pagefind-body>
<h1>{data.title}</h1>
{#if data.updated}
<p>
Written on <time datetime={data.date}
>{format(new Date(data.date), 'MMMM d, yyyy')}, last updated on
<time datetime={data.updated}
>{format(new Date(data.updated), 'MMMM d, yyyy')}.
</time></time
>
</p>
{:else}
<p>
Written on <time datetime={data.date}>{format(new Date(data.date), 'MMMM d, yyyy')}.</time>
</p>
{/if}
<svelte:component this={data.content} />
</article>
<style>
time {
margin-bottom: 4rem;
}
</style>