3 Commits

Author SHA1 Message Date
denshooter
aee811309b fix: scroll to top on locale switch and remove dashes from hero text
All checks were successful
CI / CD / test-build (push) Successful in 10m15s
CI / CD / deploy-dev (push) Has been skipped
CI / CD / deploy-production (push) Successful in 1m53s
- HeaderClient: track locale prop changes with useRef and call
  window.scrollTo on switch to reliably reset scroll position
- messages/en.json + de.json: replace em dash with comma and remove
  hyphens from Self-Hoster/Full-Stack in hero description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 14:37:56 +01:00
denshooter
48a29cd872 fix: pass locale explicitly to Hero and force-dynamic on locale-sensitive API routes
All checks were successful
CI / CD / test-build (push) Successful in 10m11s
CI / CD / deploy-dev (push) Has been skipped
CI / CD / deploy-production (push) Successful in 1m28s
- Hero.tsx: pass locale prop directly to getTranslations instead of
  relying on setRequestLocale async storage, which can be lost during
  Next.js RSC streaming
- book-reviews route: replace revalidate=300 with force-dynamic to
  prevent cached English responses being served to German locale requests
- content/page route: add runtime=nodejs and force-dynamic (was missing
  both, violating CLAUDE.md API route conventions)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 13:43:26 +01:00
denshooter
c95fc3101b chore: merge branch 'dev' into 'production' (Release: Design Overhaul & Admin Redesign)
All checks were successful
CI / CD / test-build (push) Successful in 10m9s
CI / CD / deploy-dev (push) Has been skipped
CI / CD / deploy-production (push) Successful in 24s
2026-03-08 13:18:26 +01:00
6 changed files with 17 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ import { getBookReviews } from '@/lib/directus';
import { checkRateLimit, getClientIp } from '@/lib/auth';
export const runtime = 'nodejs';
export const revalidate = 300;
export const dynamic = 'force-dynamic';
const CACHE_TTL = 300; // 5 minutes

View File

@@ -3,6 +3,9 @@ import { getContentByKey } from "@/lib/content";
import { getContentPage } from "@/lib/directus";
import { richTextToSafeHtml } from "@/lib/richtext";
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
const CACHE_TTL = 300; // 5 minutes
export async function GET(request: NextRequest) {

View File

@@ -1,6 +1,6 @@
"use client";
import { useState, useEffect } from "react";
import { useState, useEffect, useRef } from "react";
import { SiGithub, SiLinkedin } from "react-icons/si";
import Link from "next/link";
import { usePathname, useSearchParams } from "next/navigation";
@@ -27,6 +27,14 @@ export default function HeaderClient({ locale, translations }: HeaderClientProps
const [scrolled, setScrolled] = useState(false);
const pathname = usePathname();
const searchParams = useSearchParams();
const prevLocale = useRef(locale);
useEffect(() => {
if (prevLocale.current !== locale) {
window.scrollTo({ top: 0, behavior: "instant" });
prevLocale.current = locale;
}
}, [locale]);
const isHome = pathname === `/${locale}` || pathname === `/${locale}/`;

View File

@@ -5,8 +5,8 @@ interface HeroProps {
locale: string;
}
export default async function Hero({ locale: _locale }: HeroProps) {
const t = await getTranslations("home.hero");
export default async function Hero({ locale }: HeroProps) {
const t = await getTranslations({ locale, namespace: "home.hero" });
return (
<section className="relative min-h-screen flex flex-col items-center justify-center bg-stone-50 dark:bg-stone-950 px-6 transition-colors duration-500">

View File

@@ -34,7 +34,7 @@
"f2": "Docker Swarm & CI/CD",
"f3": "Self-Hosted Infrastruktur"
},
"description": "Ich bin Dennis Student aus Osnabrück und leidenschaftlicher Self-Hoster. Ich entwickle Full-Stack Apps und sorge am liebsten selbst dafür, dass sie auf meiner eigenen Infrastruktur perfekt laufen.",
"description": "Ich bin Dennis, Student aus Osnabrück und leidenschaftlicher Selfhoster. Ich entwickle Fullstack Apps und sorge am liebsten selbst dafür, dass sie auf meiner eigenen Infrastruktur perfekt laufen.",
"ctaWork": "Meine Projekte",
"ctaContact": "Kontakt"
},

View File

@@ -35,7 +35,7 @@
"f2": "Docker Swarm & CI/CD",
"f3": "Self-Hosted Infrastructure"
},
"description": "I'm Dennis a student from Germany and a passionate self-hoster. I build full-stack applications and love the challenge of managing the infrastructure they run on.",
"description": "I'm Dennis, a student from Germany and a passionate selfhoster. I build fullstack applications and love the challenge of managing the infrastructure they run on.",
"ctaWork": "View Projects",
"ctaContact": "Get in touch"
},