developers.urbit.org/pages/blog.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-06-22 23:54:19 +03:00
import Head from "next/head";
import Header from "../components/Header";
import Meta from "../components/Meta";
2022-06-28 01:01:14 +03:00
import BlogPreview from "../components/BlogPreview";
import {
Container,
SingleColumn,
Section,
} from "@urbit/foundation-design-system";
import { getAllPosts } from "@urbit/foundation-design-system";
2022-06-22 23:54:19 +03:00
import Footer from "../components/Footer";
2022-06-23 10:55:08 +03:00
export default function Blog({ posts, search }) {
2022-06-22 23:54:19 +03:00
const post = {
title: "Developer Blog",
description: "Technical-oriented posts by Urbit engineers.",
};
return (
<Container>
<Head>
<title>Blog developers.urbit.org</title>
{Meta(post)}
</Head>
2022-06-23 10:55:08 +03:00
<Header search={search} />
2022-06-22 23:54:19 +03:00
<SingleColumn>
<Section>
<h1 className="">Developer Blog</h1>
2022-06-22 23:54:19 +03:00
</Section>
<Section>
2022-06-28 01:01:14 +03:00
{posts.map((post) => (
2022-09-16 05:25:30 +03:00
<BlogPreview key={post.slug} post={post} />
2022-06-28 01:01:14 +03:00
))}
2022-06-22 23:54:19 +03:00
</Section>
</SingleColumn>
<Footer />
</Container>
);
}
export async function getStaticProps() {
const posts = getAllPosts(
["title", "slug", "date", "description", "extra"],
"blog",
"date"
);
return {
props: { posts },
};
}