Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 653f921

Browse files
fix the seo import and update the card UI
1 parent 5e5fff3 commit 653f921

File tree

1 file changed

+27
-25
lines changed
  • packages/section-blog-theme/components/Layouts

1 file changed

+27
-25
lines changed

packages/section-blog-theme/components/Layouts/Posts.tsx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as React from "react";
44
import type { PageOpts } from "nextra";
55
import { useContent } from "@/utility/useContent";
66
import dayjs from "dayjs";
7-
import { Seo } from "../Seo/Seo";
7+
import { Seo } from "@/components/Seo/Seo";
88
import { TypeSectionBlogTheme } from "@/src/types";
99

1010
export function Posts({ children, themeConfig, pageOpts }: { pageOpts: PageOpts; themeConfig: TypeSectionBlogTheme; children: React.ReactNode; }) {
@@ -20,30 +20,32 @@ export function Posts({ children, themeConfig, pageOpts }: { pageOpts: PageOpts;
2020

2121
<Article>{children}</Article>
2222

23-
<div className="mx-auto my-24 divide-y divide-slate-700 grid-cols-1 grid max-w-[724px] lg:max-w-[1024px] gap-4">
24-
{posts?.map(
25-
(post) => {
26-
27-
let getDate = dayjs(post.frontMatter.date).format(DateFormat? DateFormat : "MMM DD, YYYY");
28-
29-
if (post.frontMatter.title === undefined && post.frontMatter.description === undefined) {
30-
throw new Error(`we coud not find litile and description on follwing router: ${post.route} `)
31-
}
32-
33-
return (
34-
<ArticleCard
35-
key={post.frontMatter.date + post.frontMatter.title}
36-
title={post.frontMatter.title}
37-
description={post.frontMatter.description}
38-
tag={post.frontMatter.tags}
39-
date={getDate}
40-
URL={post.route}
41-
author={post.frontMatter?.author}
42-
/>
43-
);
44-
},
45-
)}
46-
</div>
23+
<section className="py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6">
24+
<div className="grid gap-8 lg:grid-cols-2">
25+
{posts?.map(
26+
(post) => {
27+
28+
let getDate = dayjs(post.frontMatter.date).format(DateFormat ? DateFormat : "MMM DD, YYYY");
29+
30+
if (post.frontMatter.title === undefined && post.frontMatter.description === undefined) {
31+
throw new Error(`We could not find the title and description on the following router: ${post.route} `)
32+
}
33+
34+
return (
35+
<ArticleCard
36+
key={post.frontMatter.date + post.frontMatter.title}
37+
title={post.frontMatter.title}
38+
description={post.frontMatter.description}
39+
tag={post.frontMatter.tags}
40+
date={getDate}
41+
URL={post.route}
42+
author={post.frontMatter?.author}
43+
/>
44+
);
45+
},
46+
)}
47+
</div>
48+
</section>
4749

4850
</>
4951
);

0 commit comments

Comments
 (0)