134 lines
2.7 KiB
Text
134 lines
2.7 KiB
Text
---
|
|
import BaseHead from '../../components/BaseHead.astro';
|
|
import Header from '../../components/Header.astro';
|
|
import Footer from '../../components/Footer.astro';
|
|
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
|
|
import { getCollection } from 'astro:content';
|
|
import FormattedDate from '../../components/FormattedDate.astro';
|
|
|
|
const posts = (await getCollection('blog')).sort(
|
|
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
|
|
);
|
|
const homelab_posts = (await getCollection('homelab')).sort(
|
|
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
|
|
);
|
|
---
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
|
<style>
|
|
main {
|
|
width: 960px;
|
|
}
|
|
ul {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 2rem;
|
|
list-style-type: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
ul li {
|
|
width: calc(50% - 1rem);
|
|
}
|
|
ul li * {
|
|
text-decoration: none;
|
|
transition: 0.2s ease;
|
|
}
|
|
ul li:first-child {
|
|
width: 100%;
|
|
margin-bottom: 1rem;
|
|
text-align: center;
|
|
}
|
|
ul li:first-child img {
|
|
width: 100%;
|
|
}
|
|
ul li:first-child .title {
|
|
font-size: 2.369rem;
|
|
}
|
|
ul li img {
|
|
margin-bottom: 0.5rem;
|
|
border-radius: 12px;
|
|
}
|
|
ul li a {
|
|
display: block;
|
|
}
|
|
.title {
|
|
margin: 0;
|
|
color: rgb(0,255,159);
|
|
line-height: 1;
|
|
}
|
|
.date {
|
|
margin: 0;
|
|
color: rgb(white);
|
|
}
|
|
ul li a:hover h4,
|
|
ul li a:hover .date {
|
|
color: rgb(var(--accent));
|
|
}
|
|
ul a:hover img {
|
|
box-shadow: var(--box-shadow);
|
|
}
|
|
@media (max-width: 720px) {
|
|
ul {
|
|
gap: 0.5em;
|
|
}
|
|
ul li {
|
|
width: 100%;
|
|
text-align: center;
|
|
}
|
|
ul li:first-child {
|
|
margin-bottom: 0;
|
|
}
|
|
ul li:first-child .title {
|
|
font-size: 1.563em;
|
|
}
|
|
}
|
|
blogheader {
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<Header />
|
|
<main>
|
|
<blogheader>
|
|
<h1>Blog</h1>
|
|
<p>
|
|
This page contains a blog about nothing and everything going on with me.
|
|
I will probably post mostly random stuff or opinion pieces. What it will be about i have no idea.
|
|
So stay tuned!
|
|
</p>
|
|
</blogheader>
|
|
<section>
|
|
<ul>
|
|
{
|
|
posts.map((post) => (
|
|
<li>
|
|
<a href={`/blog/${post.slug}/`}>
|
|
<h4 class="title">{post.data.title}</h4>
|
|
<p class="date">
|
|
<FormattedDate date={post.data.pubDate} />
|
|
</p>
|
|
</a>
|
|
</li>
|
|
))
|
|
}
|
|
{ homelab_posts.map((post) => (
|
|
<li>
|
|
<a href={`/homelab/${post.slug}/`}>
|
|
<h4 class="title">{post.data.title}</h4>
|
|
<p class="date">
|
|
<FormattedDate date={post.data.pubDate} />
|
|
</p>
|
|
</a>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</section>
|
|
</main>
|
|
<Footer />
|
|
</body>
|
|
</html>
|