fix: locale parsing error in RecentPosts
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Failing after 1m52s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s

- safely parse locale string for toLocaleDateString

- add 100 to images.qualities in next.config.mjs to suppress warnings
This commit is contained in:
2026-03-03 11:38:01 +01:00
parent 02be8e59b2
commit b033142599
2 changed files with 9 additions and 5 deletions

View File

@@ -74,11 +74,14 @@ export default async function RecentPosts({ locale, data }: RecentPostsProps) {
suppressHydrationWarning
className="px-3 py-1 text-white/80 text-[10px] md:text-xs font-bold uppercase tracking-widest border border-white/20 rounded-full bg-white/10 backdrop-blur-md"
>
{new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', {
year: 'numeric',
month: 'short',
day: 'numeric',
})}
{new Date(post.frontmatter.date).toLocaleDateString(
['en', 'de'].includes(locale) ? locale : 'de',
{
year: 'numeric',
month: 'short',
day: 'numeric',
},
)}
</time>
{(new Date(post.frontmatter.date) > new Date() ||
post.frontmatter.public === false) && (

View File

@@ -393,6 +393,7 @@ const nextConfig = {
];
},
images: {
qualities: [75, 100],
formats: ['image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
remotePatterns: [