2023-05-18 13:40:53 +02:00
|
|
|
---
|
2023-05-18 17:31:16 +02:00
|
|
|
import { getEntryBySlug, getCollection } from "astro:content";
|
2023-05-22 22:27:49 +02:00
|
|
|
import { Image } from "astro:assets";
|
2023-05-18 17:31:16 +02:00
|
|
|
import PageLayout from "../layouts/PageLayout.astro";
|
|
|
|
|
import PublicationDate from "../components/PublicationDate.astro";
|
|
|
|
|
|
2023-05-22 22:27:49 +02:00
|
|
|
const about = await getEntryBySlug("about", "about");
|
|
|
|
|
const { Content } = await about.render();
|
2023-05-18 17:31:16 +02:00
|
|
|
|
|
|
|
|
const articles = (await getCollection("blog")).sort(
|
|
|
|
|
(a, b) => b.data.publicationDate.valueOf() - a.data.publicationDate.valueOf()
|
|
|
|
|
);
|
2023-05-18 13:40:53 +02:00
|
|
|
---
|
|
|
|
|
|
2023-05-22 22:27:49 +02:00
|
|
|
<PageLayout title="aurora" description="Minimalistic blog theme built with Astro, focused on accessibility and usability.">
|
2023-05-18 17:31:16 +02:00
|
|
|
<Content />
|
2023-05-22 22:27:49 +02:00
|
|
|
<div class="article-grid">
|
|
|
|
|
{
|
|
|
|
|
articles.map((article) => (
|
|
|
|
|
<article>
|
|
|
|
|
<header>
|
|
|
|
|
<Image src={article.data.cover} alt={article.data.coverAlt} width="320" height="180" />
|
|
|
|
|
</header>
|
|
|
|
|
<div class="article-content">
|
|
|
|
|
<PublicationDate publicationDate={article.data.publicationDate} />
|
|
|
|
|
<h2>
|
|
|
|
|
<a href={article.slug}>{article.data.title}</a>
|
|
|
|
|
</h2>
|
|
|
|
|
<p>{article.data.description}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2023-05-18 17:31:16 +02:00
|
|
|
</PageLayout>
|
|
|
|
|
|
|
|
|
|
<style>
|
2023-05-22 22:27:49 +02:00
|
|
|
.article-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: var(--size-7);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
article {
|
|
|
|
|
border: var(--standard-border);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-28 23:22:49 +02:00
|
|
|
article > header {
|
2023-05-22 22:27:49 +02:00
|
|
|
padding: 0;
|
|
|
|
|
border-block-end: var(--standard-border);
|
|
|
|
|
padding-inline: var(--size-3);
|
|
|
|
|
padding-block: var(--size-7);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
article img {
|
|
|
|
|
margin-inline: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.article-content {
|
|
|
|
|
padding: var(--size-3);
|
2023-05-18 17:31:16 +02:00
|
|
|
}
|
|
|
|
|
</style>
|