first commit
This commit is contained in:
45
src/routes/+page.svelte
Normal file
45
src/routes/+page.svelte
Normal file
@@ -0,0 +1,45 @@
|
||||
<script>
|
||||
import Header from "$lib/ui/header.svelte";
|
||||
|
||||
export let data;
|
||||
|
||||
let { blog } = data;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<Header
|
||||
title={blog?.site.title}
|
||||
subtitle={blog?.site.subtitle}
|
||||
/>
|
||||
<div class="bg-gray-100 py-20">
|
||||
<div class="section-wrapper">
|
||||
<h2 class="text-2xl mb-8 font-bold">Latest articles</h2>
|
||||
|
||||
<div class="flex flex-col gap-5">
|
||||
{#each blog?.articles || [] as article}
|
||||
<a href="/{article.seo_slug}">
|
||||
<div
|
||||
class="bg-white rounded-3xl px-8 py-8 flex flex-row sm:flex-col"
|
||||
>
|
||||
<div>
|
||||
<span
|
||||
class="text-sm text-gray-400 font-normal mb-8"
|
||||
>{new Date(
|
||||
article.created_at,
|
||||
).toLocaleDateString("en-de", {
|
||||
day: "2-digit",
|
||||
month: "long",
|
||||
year: "numeric",
|
||||
})}</span
|
||||
>
|
||||
<h3 class="text-2xl font-semibold">
|
||||
{article.title}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user