From 84b0f48224750cf61a07133b5e9bea19accf3aeb Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Wed, 25 Dec 2024 18:12:04 -0500 Subject: [PATCH] fix latest blogposts --- docusaurus.config.js | 17 ++--- src/components/BlogHistory.tsx | 115 +++++++++++++++++++++------------ src/pages/index.js | 10 +-- 3 files changed, 84 insertions(+), 58 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 1f96e0616..96ab8d37b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -58,15 +58,16 @@ const config = { editUrl: 'https://github.com/DidierRLopes/my-website/tree/main/', feedOptions: { type: 'all', + limit: 2000, copyright: `Copyright © ${new Date().getFullYear()} Didier Lopes.`, - createFeedItems: async (params) => { - const { blogPosts, defaultCreateFeedItems, ...rest } = params; - return defaultCreateFeedItems({ - // keep only the 10 most recent blog posts in the feed - blogPosts: blogPosts, //.filter((item, index) => index < 10), - ...rest, - }); - }, + // createFeedItems: async (params) => { + // const { blogPosts, defaultCreateFeedItems, ...rest } = params; + // return defaultCreateFeedItems({ + // // keep only the 10 most recent blog posts in the feed + // blogPosts: blogPosts, //.filter((item, index) => index < 10), + // ...rest, + // }); + // }, }, }, theme: { diff --git a/src/components/BlogHistory.tsx b/src/components/BlogHistory.tsx index 338a7de93..563a6a411 100644 --- a/src/components/BlogHistory.tsx +++ b/src/components/BlogHistory.tsx @@ -42,6 +42,7 @@ export default function BlogHistory({ posts = [] }: BlogHistoryProps) { summary: post.summary, contentSize: post.content_html.length / 1024, url: post.url, + content_html: post.content_html, })); const [activeIndex, setActiveIndex] = React.useState(null); @@ -120,51 +121,79 @@ export default function BlogHistory({ posts = [] }: BlogHistoryProps) { backdropFilter: "blur(5px)", borderRadius: "8px", boxShadow: "0 2px 10px rgba(0,0,0,0.1)", + width: "600px", }} > -

- {data.date.toLocaleDateString(undefined, { - year: "numeric", - month: "long", - day: "numeric", - })} -

-

- {data.title} -

-

- {data.summary} -

-

- (click bar to view post) -

+
+
+ {data.title} +
+
+

+ {data.date.toLocaleDateString(undefined, { + year: "numeric", + month: "long", + day: "numeric", + })} +

+

+ {data.title} +

+

+ {data.summary} +

+

+ (click bar to view post) +

+
+
); } diff --git a/src/pages/index.js b/src/pages/index.js index f0e44b737..c0cd47eda 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -319,8 +319,9 @@ export default function Home() {

Latest Blog Posts

+ {allPosts && allPosts.length > 0 && } {isDesktop ? ( -
+