diff --git a/app/[locale]/blog/[slug]/page.tsx b/app/[locale]/blog/[slug]/page.tsx index 112ca652..8b628c9b 100644 --- a/app/[locale]/blog/[slug]/page.tsx +++ b/app/[locale]/blog/[slug]/page.tsx @@ -76,7 +76,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
{post.frontmatter.title} ) : (
@@ -82,7 +82,7 @@ export default function PostNavigation({ {next.frontmatter.featuredImage ? (
) : (
diff --git a/components/home/RecentPosts.tsx b/components/home/RecentPosts.tsx index 578d6ea8..da4117fb 100644 --- a/components/home/RecentPosts.tsx +++ b/components/home/RecentPosts.tsx @@ -43,7 +43,7 @@ export default async function RecentPosts({ locale }: RecentPostsProps) { {post.frontmatter.featuredImage && (
{post.frontmatter.title} 0) { + calculatedHeight = Math.round(width * (arH / arW)); + resizingType = 'fill'; // Must use fill to allow imgproxy to crop + } + } + url.searchParams.delete('ar'); + } + + if (customGravity || aspectRatio) { cleanSrc = src.startsWith('http') ? url.href : url.pathname + url.search; } } catch (e) { @@ -41,10 +61,11 @@ export default function imgproxyLoader({ } // We use the width provided by Next.js for responsive images - // Height is set to 0 to maintain aspect ratio + // Height is calculated from aspect ratio if provided, otherwise 0 to maintain aspect ratio return getImgproxyUrl(cleanSrc, { width, - resizing_type: 'fit', + height: calculatedHeight, + resizing_type: resizingType, gravity, }); }