first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
39
apps/web/app/(marketing)/[locale]/blog/page.tsx
Normal file
39
apps/web/app/(marketing)/[locale]/blog/page.tsx
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { PostListItem } from "@marketing/blog/components/PostListItem";
|
||||
import { getAllPosts } from "@marketing/blog/utils/lib/posts";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
return {
|
||||
title: t("blog.title"),
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogListPage() {
|
||||
const locale = await getLocale();
|
||||
const t = await getTranslations();
|
||||
|
||||
const posts = await getAllPosts();
|
||||
|
||||
return (
|
||||
<div className="container max-w-6xl pt-32 pb-16">
|
||||
<div className="mb-12 pt-8 text-center">
|
||||
<h1 className="mb-2 font-bold text-5xl">{t("blog.title")}</h1>
|
||||
<p className="text-lg opacity-50">{t("blog.description")}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-8 md:grid-cols-2">
|
||||
{posts
|
||||
.filter((post) => post.published && locale === post.locale)
|
||||
.sort(
|
||||
(a, b) =>
|
||||
new Date(b.date).getTime() -
|
||||
new Date(a.date).getTime(),
|
||||
)
|
||||
.map((post) => (
|
||||
<PostListItem post={post} key={post.path} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue