mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* refactor: improve dx for writing a docs component (#2544) * refactor: improve dx for write a docs component Signed-off-by: Innei <i@innei.in> * refactor(docs): switch to contentlayer2 * chore(docs): rename to avoid conflict * refactor(docs): switch to next-contentlayer2 * refactor(docs): revise docs lib * chore(deps): bump docs related dependencies * fix(use-aria-multiselect): type issue due to ts version bump --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: WK Wong <wingkwong.code@gmail.com> * refactor(docs): accordion codes * feat(docs): declare module `*.jsx?raw` * feat(docs): include `**/*.jsx` * fix(docs): incorrect content * chore(docs): add new lines * refactor(docs): lint --------- Signed-off-by: Innei <i@innei.in> Co-authored-by: Innei <tukon479@gmail.com>
30 lines
821 B
TypeScript
30 lines
821 B
TypeScript
import {allBlogPosts} from "contentlayer2/generated";
|
|
import {compareDesc} from "date-fns";
|
|
|
|
import {BlogPostList} from "@/components/blog-post";
|
|
import {__DEV__, __PREVIEW__} from "@/utils";
|
|
|
|
const isDraftVisible = __DEV__ || __PREVIEW__;
|
|
|
|
export default function Blog() {
|
|
const posts = allBlogPosts
|
|
.sort((a, b) => compareDesc(new Date(a.date), new Date(b.date)))
|
|
?.filter((post) => {
|
|
if (post.draft && !isDraftVisible) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
});
|
|
|
|
return (
|
|
<div className="w-full lg:px-16 mt-12">
|
|
<div className="text-center">
|
|
<h1 className="mb-2 font-bold text-4xl">NextUI Latest Updates</h1>
|
|
<h5 className="text-default-500 text-lg">All the latest news about NextUI.</h5>
|
|
</div>
|
|
<BlogPostList posts={posts} />
|
|
</div>
|
|
);
|
|
}
|