✨ add SectionContainer for all pages & layouts
This commit is contained in:
parent
693dbbda16
commit
964d609197
6 changed files with 142 additions and 175 deletions
|
@ -1,57 +1,44 @@
|
|||
---
|
||||
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';
|
||||
import SectionContainer from '../../components/SectionContainer.astro';
|
||||
|
||||
const posts = (await getCollection('blog')).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
|
||||
);
|
||||
---
|
||||
<SectionContainer>
|
||||
<main class="flex flex-col h-screen gap-4 mt-4">
|
||||
<h1 class="text-4xl font-extrabold">Blog posts</h1>
|
||||
<section class="mt-4">
|
||||
<ul>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li>
|
||||
<FormattedDate date={post.data.pubDate} />
|
||||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
</SectionContainer>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
<style>
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: unset;
|
||||
}
|
||||
ul li {
|
||||
display: flex;
|
||||
}
|
||||
ul li :global(time) {
|
||||
flex: 0 0 130px;
|
||||
font-style: italic;
|
||||
color: #595959;
|
||||
}
|
||||
ul li a {
|
||||
color: #815B5B;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex flex-col fixed w-screen">
|
||||
<Header />
|
||||
<main class="flex flex-col justify-center items-left mx-auto">
|
||||
<h1 class="text-4xl font-extrabold">Blog posts</h1>
|
||||
<section class="mt-4">
|
||||
<ul>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li>
|
||||
<FormattedDate date={post.data.pubDate} />
|
||||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<style>
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: unset;
|
||||
}
|
||||
ul li {
|
||||
display: flex;
|
||||
}
|
||||
ul li :global(time) {
|
||||
flex: 0 0 130px;
|
||||
font-style: italic;
|
||||
color: #595959;
|
||||
}
|
||||
ul li a {
|
||||
color: #815B5B;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue