Skip to content

Commit ace5005

Browse files
committed
fix
1 parent ba60c20 commit ace5005

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

blog/2026-01-12-joining-c-more-as-an-advisor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ I dedicate all my time to OpenBB. But when [Carolina](https://www.linkedin.com/i
1717

1818
<!-- truncate -->
1919

20+
<p align="center">
21+
<img width="800" src="/blog/2026-01-12-joining-c-more-as-an-advisor.webp" alt="C-MORE advisory announcement" />
22+
</p>
23+
2024
## Background
2125

2226
I've been hands-on with AI and machine learning since 2016, when I first applied Neural Networks to control systems in university. Since then, I've stayed close to the intersection of data, AI, and finance - implementing LSTM networks for financial time series forecasting ([open-sourced here](/blog/an-unusual-journey-learning-about-nns-for-a-phd-thesis)), and more recently fine-tuning small language models running locally ([detailed here](/blog/fine-tuning-a-llm-on-my-blog-posts)).

src/components/home/LatestPosts.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,27 @@ import BlogHistory from '../BlogHistory';
44
import { Carousel } from 'react-responsive-carousel';
55
import 'react-responsive-carousel/lib/styles/carousel.min.css';
66

7+
// Construct hero image URL from post date and slug
8+
// Pattern: /blog/YYYY-MM-DD-slug.webp
9+
const getHeroImage = (post) => {
10+
if (!post.date_modified || !post.id) return null;
11+
const date = new Date(post.date_modified);
12+
// Use UTC methods to avoid timezone issues
13+
const yyyy = date.getUTCFullYear();
14+
const mm = String(date.getUTCMonth() + 1).padStart(2, '0');
15+
const dd = String(date.getUTCDate()).padStart(2, '0');
16+
// Extract slug from URL like "https://didierlopes.com/blog/my-slug"
17+
const slug = post.id.split('/blog/')[1];
18+
if (!slug) return null;
19+
return `/blog/${yyyy}-${mm}-${dd}-${slug}.webp`;
20+
};
21+
722
function LatestPosts({ allPosts, postsHighlight, isDesktop, isTablet }) {
8-
// Ensure we never display more than 3 highlight posts
9-
const highlights = (postsHighlight || []).slice(0, 3);
23+
// Ensure we never display more than 3 highlight posts with hero images
24+
const highlights = (postsHighlight || [])
25+
.map(post => ({ ...post, image: getHeroImage(post) }))
26+
.filter(post => post.image)
27+
.slice(0, 3);
1028

1129
return (
1230
<Section title="Latest posts." subtitle="I write so I can think and communicate better.">
@@ -25,7 +43,7 @@ function LatestPosts({ allPosts, postsHighlight, isDesktop, isTablet }) {
2543
<div className="overflow-hidden rounded-xl mb-3">
2644
<img
2745
className="w-full h-[180px] object-cover transition-transform duration-300 hover:scale-110"
28-
src={post.content_html.match(/<img.*?src=\"(.*?)\"/)[1]}
46+
src={post.image}
2947
alt={post.title}
3048
/>
3149
</div>
@@ -46,7 +64,7 @@ function LatestPosts({ allPosts, postsHighlight, isDesktop, isTablet }) {
4664
<div className="overflow-hidden rounded-xl mb-3">
4765
<img
4866
className="w-full h-[180px] object-cover transition-transform duration-300 group-hover:scale-110"
49-
src={post.content_html.match(/<img.*?src=\"(.*?)\"/)[1]}
67+
src={post.image}
5068
alt={post.title}
5169
/>
5270
</div>
@@ -98,7 +116,7 @@ function LatestPosts({ allPosts, postsHighlight, isDesktop, isTablet }) {
98116
<a href={`${post.id}`} className="group block pt-12">
99117
<img
100118
className="rounded-xl h-[120px] mx-auto object-cover"
101-
src={post.content_html.match(/<img.*?src=\"(.*?)\"/)[1]}
119+
src={post.image}
102120
alt={post.title}
103121
/>
104122
<h3 className="text-center text-sm font-semibold mt-2 group-hover:text-blue-500 transition-colors duration-300">

0 commit comments

Comments
 (0)