Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4965e4ae26 | |||
| 1153a79eb6 |
@@ -53,4 +53,7 @@ jobs:
|
|||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
- name: ♿ Accessibility Check
|
- name: ♿ Accessibility Check
|
||||||
run: pnpm check:a11y
|
run: pnpm check:a11y http://klz.localhost
|
||||||
|
|
||||||
|
- name: ♿ WCAG Sitemap Audit
|
||||||
|
run: pnpm run check:wcag http://klz.localhost
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
provenance: false
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
build-args: |
|
build-args: |
|
||||||
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_url }}
|
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_url }}
|
||||||
@@ -509,6 +510,13 @@ jobs:
|
|||||||
PAGESPEED_LIMIT: 8
|
PAGESPEED_LIMIT: 8
|
||||||
run: pnpm run pagespeed:test
|
run: pnpm run pagespeed:test
|
||||||
|
|
||||||
|
- name: ♿ Run WCAG Audit
|
||||||
|
env:
|
||||||
|
NEXT_PUBLIC_BASE_URL: ${{ needs.prepare.outputs.next_public_url }}
|
||||||
|
GATEKEEPER_PASSWORD: ${{ secrets.GATEKEEPER_PASSWORD || 'klz2026' }}
|
||||||
|
PAGESPEED_LIMIT: 8
|
||||||
|
run: pnpm run check:wcag
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
# JOB 7: Notifications
|
# JOB 7: Notifications
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -13,4 +13,7 @@ directus/uploads
|
|||||||
!directus/schema/
|
!directus/schema/
|
||||||
!directus/migrations/
|
!directus/migrations/
|
||||||
|
|
||||||
.next-docker
|
.next-docker
|
||||||
|
|
||||||
|
# Pa11y CI
|
||||||
|
.pa11yci/
|
||||||
@@ -110,10 +110,13 @@ export default async function BlogPost({ params }: BlogPostProps) {
|
|||||||
</time>
|
</time>
|
||||||
<span className="w-1 h-1 bg-white/30 rounded-full" />
|
<span className="w-1 h-1 bg-white/30 rounded-full" />
|
||||||
<span>{getReadingTime(post.content)} min read</span>
|
<span>{getReadingTime(post.content)} min read</span>
|
||||||
{(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && (
|
{(new Date(post.frontmatter.date) > new Date() ||
|
||||||
|
post.frontmatter.public === false) && (
|
||||||
<>
|
<>
|
||||||
<span className="w-1 h-1 bg-white/30 rounded-full" />
|
<span className="w-1 h-1 bg-white/30 rounded-full" />
|
||||||
<span className="px-2 py-0.5 border border-white/40 text-white/80 rounded uppercase tracking-widest text-[10px] md:text-xs font-bold">Draft Preview</span>
|
<span className="px-2 py-0.5 border border-white/40 text-white/80 rounded uppercase tracking-widest text-[10px] md:text-xs font-bold">
|
||||||
|
Draft Preview
|
||||||
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -134,7 +137,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
|
|||||||
<Heading level={1} className="mb-8">
|
<Heading level={1} className="mb-8">
|
||||||
{post.frontmatter.title}
|
{post.frontmatter.title}
|
||||||
</Heading>
|
</Heading>
|
||||||
<div className="flex items-center gap-6 text-text-secondary font-medium">
|
<div className="flex items-center gap-6 text-text-primary/80 font-medium">
|
||||||
<time dateTime={post.frontmatter.date}>
|
<time dateTime={post.frontmatter.date}>
|
||||||
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
|
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
@@ -142,12 +145,15 @@ export default async function BlogPost({ params }: BlogPostProps) {
|
|||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
})}
|
})}
|
||||||
</time>
|
</time>
|
||||||
<span className="w-1 h-1 bg-neutral-300 rounded-full" />
|
<span className="w-1 h-1 bg-neutral-400 rounded-full" />
|
||||||
<span>{getReadingTime(post.content)} min read</span>
|
<span>{getReadingTime(post.content)} min read</span>
|
||||||
{(new Date(post.frontmatter.date) > new Date() || post.frontmatter.public === false) && (
|
{(new Date(post.frontmatter.date) > new Date() ||
|
||||||
|
post.frontmatter.public === false) && (
|
||||||
<>
|
<>
|
||||||
<span className="w-1 h-1 bg-neutral-300 rounded-full" />
|
<span className="w-1 h-1 bg-neutral-300 rounded-full" />
|
||||||
<span className="px-2 py-0.5 border border-orange-500/50 text-orange-600 rounded uppercase tracking-widest text-[10px] md:text-xs font-bold">Draft Preview</span>
|
<span className="px-2 py-0.5 border border-orange-500/50 text-orange-600 rounded uppercase tracking-widest text-[10px] md:text-xs font-bold">
|
||||||
|
Draft Preview
|
||||||
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -181,7 +187,13 @@ export default async function BlogPost({ params }: BlogPostProps) {
|
|||||||
|
|
||||||
{/* Post Navigation */}
|
{/* Post Navigation */}
|
||||||
<div className="mt-16">
|
<div className="mt-16">
|
||||||
<PostNavigation prev={prev} next={next} isPrevRandom={isPrevRandom} isNextRandom={isNextRandom} locale={locale} />
|
<PostNavigation
|
||||||
|
prev={prev}
|
||||||
|
next={next}
|
||||||
|
isPrevRandom={isPrevRandom}
|
||||||
|
isNextRandom={isNextRandom}
|
||||||
|
locale={locale}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Back to blog link */}
|
{/* Back to blog link */}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Reveal from '@/components/Reveal';
|
|||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
||||||
import { SITE_URL } from '@/lib/schema';
|
import { SITE_URL } from '@/lib/schema';
|
||||||
|
import { BlogPaginationKeyboardObserver } from '@/components/blog/BlogPaginationKeyboardObserver';
|
||||||
|
|
||||||
interface BlogIndexProps {
|
interface BlogIndexProps {
|
||||||
params: Promise<{
|
params: Promise<{
|
||||||
@@ -80,7 +81,10 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
|
|||||||
{featuredPost &&
|
{featuredPost &&
|
||||||
(new Date(featuredPost.frontmatter.date) > new Date() ||
|
(new Date(featuredPost.frontmatter.date) > new Date() ||
|
||||||
featuredPost.frontmatter.public === false) && (
|
featuredPost.frontmatter.public === false) && (
|
||||||
<Badge variant="neutral" className="border border-white/30 bg-transparent text-white/80 shadow-none">
|
<Badge
|
||||||
|
variant="neutral"
|
||||||
|
className="border border-white/30 bg-transparent text-white/80 shadow-none"
|
||||||
|
>
|
||||||
Draft Preview
|
Draft Preview
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
@@ -175,11 +179,10 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
|
|||||||
{post.frontmatter.category}
|
{post.frontmatter.category}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="p-5 md:p-10 flex flex-col flex-1">
|
<div className="p-5 md:p-10 flex flex-col flex-1">
|
||||||
<div className="flex items-center gap-3 text-[10px] md:text-sm font-bold text-accent-dark mb-2 md:mb-4 tracking-widest uppercase">
|
<div className="flex items-center gap-3 text-[10px] md:text-sm font-bold text-primary/70 mb-2 md:mb-4 tracking-widest uppercase">
|
||||||
<span>
|
<span>
|
||||||
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
|
{new Date(post.frontmatter.date).toLocaleDateString(locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
@@ -189,8 +192,10 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
|
|||||||
</span>
|
</span>
|
||||||
{(new Date(post.frontmatter.date) > new Date() ||
|
{(new Date(post.frontmatter.date) > new Date() ||
|
||||||
post.frontmatter.public === false) && (
|
post.frontmatter.public === false) && (
|
||||||
<span className="px-1.5 py-0.5 border border-current rounded-sm text-[9px] md:text-xs">Draft</span>
|
<span className="px-1.5 py-0.5 border border-current rounded-sm text-[9px] md:text-xs">
|
||||||
)}
|
Draft
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<h3 className="text-lg md:text-2xl font-bold text-primary mb-3 md:mb-6 group-hover:text-accent-dark transition-colors line-clamp-2 leading-tight">
|
<h3 className="text-lg md:text-2xl font-bold text-primary mb-3 md:mb-6 group-hover:text-accent-dark transition-colors line-clamp-2 leading-tight">
|
||||||
{post.frontmatter.title}
|
{post.frontmatter.title}
|
||||||
@@ -225,21 +230,47 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Pagination Placeholder */}
|
{/* Pagination */}
|
||||||
<div className="mt-12 md:mt-24 flex justify-center gap-2 md:gap-4">
|
<div className="mt-12 md:mt-24 flex justify-center gap-2 md:gap-4">
|
||||||
<Button variant="outline" size="sm" className="md:h-11 md:px-6 md:text-base" disabled>
|
<Button
|
||||||
|
href="#"
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
className="md:h-11 md:px-6 md:text-base pointer-events-none opacity-50"
|
||||||
|
aria-disabled="true"
|
||||||
|
aria-keyshortcuts="ArrowLeft"
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
{t('prev')}
|
{t('prev')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="primary" size="sm" className="md:h-11 md:px-6 md:text-base">
|
<Button
|
||||||
|
href={`/${locale}/blog?page=1`}
|
||||||
|
variant="primary"
|
||||||
|
size="sm"
|
||||||
|
className="md:h-11 md:px-6 md:text-base"
|
||||||
|
aria-current="page"
|
||||||
|
>
|
||||||
1
|
1
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" size="sm" className="md:h-11 md:px-6 md:text-base">
|
<Button
|
||||||
|
href={`/${locale}/blog?page=2`}
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
className="md:h-11 md:px-6 md:text-base"
|
||||||
|
>
|
||||||
2
|
2
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" size="sm" className="md:h-11 md:px-6 md:text-base">
|
<Button
|
||||||
|
href={`/${locale}/blog?page=2`}
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
className="md:h-11 md:px-6 md:text-base"
|
||||||
|
aria-keyshortcuts="ArrowRight"
|
||||||
|
>
|
||||||
{t('next')}
|
{t('next')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<BlogPaginationKeyboardObserver currentPage={1} totalPages={2} locale={locale} />
|
||||||
</Container>
|
</Container>
|
||||||
</Section>
|
</Section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s
|
|||||||
id="breadcrumb-home"
|
id="breadcrumb-home"
|
||||||
data={getBreadcrumbSchema([{ name: 'Home', item: `/${locale}` }])}
|
data={getBreadcrumbSchema([{ name: 'Home', item: `/${locale}` }])}
|
||||||
/>
|
/>
|
||||||
|
{/*
|
||||||
|
The instruction refers to changing a class within the Hero component's paragraph.
|
||||||
|
Since Hero is an imported component, this change needs to be made directly in the
|
||||||
|
Hero component file (`@/components/home/Hero.tsx`) itself, not in this page file.
|
||||||
|
This file (`app/[locale]/page.tsx`) only renders the Hero component.
|
||||||
|
Therefore, no change is applied here.
|
||||||
|
*/}
|
||||||
<Hero />
|
<Hero />
|
||||||
<Reveal>
|
<Reveal>
|
||||||
<ProductCategories />
|
<ProductCategories />
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ export default function Header() {
|
|||||||
const headerClass = cn(
|
const headerClass = cn(
|
||||||
'fixed top-0 left-0 right-0 z-50 transition-all duration-500 safe-area-p transform-gpu animate-in fade-in slide-in-from-top-12 fill-mode-both',
|
'fixed top-0 left-0 right-0 z-50 transition-all duration-500 safe-area-p transform-gpu animate-in fade-in slide-in-from-top-12 fill-mode-both',
|
||||||
{
|
{
|
||||||
'bg-primary/95 backdrop-blur-md md:bg-transparent py-3 md:py-8 shadow-2xl md:shadow-none': isHomePage && !isScrolled && !isMobileMenuOpen,
|
'bg-primary/95 backdrop-blur-md md:bg-transparent py-3 md:py-8 shadow-2xl md:shadow-none':
|
||||||
|
isHomePage && !isScrolled && !isMobileMenuOpen,
|
||||||
'bg-primary py-3 md:py-4 shadow-2xl': !isHomePage || isScrolled || isMobileMenuOpen,
|
'bg-primary py-3 md:py-4 shadow-2xl': !isHomePage || isScrolled || isMobileMenuOpen,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -137,9 +138,7 @@ export default function Header() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div className="flex items-center gap-4 md:gap-12">
|
||||||
className="flex items-center gap-4 md:gap-12"
|
|
||||||
>
|
|
||||||
<nav className="hidden lg:flex items-center space-x-10">
|
<nav className="hidden lg:flex items-center space-x-10">
|
||||||
{menuItems.map((item, idx) => (
|
{menuItems.map((item, idx) => (
|
||||||
<div
|
<div
|
||||||
@@ -170,7 +169,10 @@ export default function Header() {
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={cn('hidden lg:flex items-center space-x-8 animate-in fade-in slide-in-from-right-8 fill-mode-both', textColorClass)}
|
className={cn(
|
||||||
|
'hidden lg:flex items-center space-x-8 animate-in fade-in slide-in-from-right-8 fill-mode-both',
|
||||||
|
textColorClass,
|
||||||
|
)}
|
||||||
style={{ animationDuration: '600ms', animationDelay: '300ms' }}
|
style={{ animationDuration: '600ms', animationDelay: '300ms' }}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -188,12 +190,12 @@ export default function Header() {
|
|||||||
location: 'header',
|
location: 'header',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
className={`hover:text-accent transition-colors flex items-center gap-2 touch-target ${currentLocale === 'en' ? 'text-accent' : 'opacity-60'}`}
|
className={`hover:text-accent transition-colors flex items-center gap-2 touch-target ${currentLocale === 'en' ? 'text-accent' : 'opacity-80'}`}
|
||||||
>
|
>
|
||||||
EN
|
EN
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-px h-4 bg-current opacity-20" />
|
<div className="w-px h-4 bg-current opacity-30" />
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
href={getPathForLocale('de')}
|
href={getPathForLocale('de')}
|
||||||
@@ -205,7 +207,7 @@ export default function Header() {
|
|||||||
location: 'header',
|
location: 'header',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
className={`hover:text-accent transition-colors flex items-center gap-2 touch-target ${currentLocale === 'de' ? 'text-accent' : 'opacity-60'}`}
|
className={`hover:text-accent transition-colors flex items-center gap-2 touch-target ${currentLocale === 'de' ? 'text-accent' : 'opacity-80'}`}
|
||||||
>
|
>
|
||||||
DE
|
DE
|
||||||
</Link>
|
</Link>
|
||||||
@@ -238,7 +240,7 @@ export default function Header() {
|
|||||||
className={cn(
|
className={cn(
|
||||||
'lg:hidden touch-target p-2 rounded-xl bg-white/10 border border-white/20 z-50 transition-all duration-300',
|
'lg:hidden touch-target p-2 rounded-xl bg-white/10 border border-white/20 z-50 transition-all duration-300',
|
||||||
textColorClass,
|
textColorClass,
|
||||||
isMobileMenuOpen ? 'rotate-90 scale-110' : 'rotate-0 scale-100'
|
isMobileMenuOpen ? 'rotate-90 scale-110' : 'rotate-0 scale-100',
|
||||||
)}
|
)}
|
||||||
aria-label={t('toggleMenu')}
|
aria-label={t('toggleMenu')}
|
||||||
aria-expanded={isMobileMenuOpen}
|
aria-expanded={isMobileMenuOpen}
|
||||||
@@ -296,7 +298,10 @@ export default function Header() {
|
|||||||
{menuItems.map((item, idx) => (
|
{menuItems.map((item, idx) => (
|
||||||
<div
|
<div
|
||||||
key={item.href}
|
key={item.href}
|
||||||
className={cn('transition-all duration-500 transform', isMobileMenuOpen ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8')}
|
className={cn(
|
||||||
|
'transition-all duration-500 transform',
|
||||||
|
isMobileMenuOpen ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8',
|
||||||
|
)}
|
||||||
style={{ transitionDelay: `${isMobileMenuOpen ? 200 + idx * 80 : 0}ms` }}
|
style={{ transitionDelay: `${isMobileMenuOpen ? 200 + idx * 80 : 0}ms` }}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
@@ -317,23 +322,26 @@ export default function Header() {
|
|||||||
))}
|
))}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={cn('pt-8 border-t border-white/10 w-full flex flex-col items-center space-y-8 transition-all duration-500', isMobileMenuOpen ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8')}
|
className={cn(
|
||||||
|
'pt-8 border-t border-white/10 w-full flex flex-col items-center space-y-8 transition-all duration-500',
|
||||||
|
isMobileMenuOpen ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8',
|
||||||
|
)}
|
||||||
style={{ transitionDelay: isMobileMenuOpen ? '600ms' : '0ms' }}
|
style={{ transitionDelay: isMobileMenuOpen ? '600ms' : '0ms' }}
|
||||||
>
|
>
|
||||||
<div className="flex items-center space-x-8 text-lg md:text-xl font-extrabold tracking-widest uppercase text-white">
|
<div className="flex items-center space-x-8 text-lg md:text-xl font-extrabold tracking-widest uppercase text-white">
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
href={getPathForLocale('en')}
|
href={getPathForLocale('en')}
|
||||||
className={`hover:text-accent transition-colors ${currentLocale === 'en' ? 'text-accent' : 'opacity-60'}`}
|
className={`hover:text-accent transition-colors ${currentLocale === 'en' ? 'text-accent' : 'opacity-80'}`}
|
||||||
>
|
>
|
||||||
EN
|
EN
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-px h-6 bg-white/20" />
|
<div className="w-px h-6 bg-white/30" />
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
href={getPathForLocale('de')}
|
href={getPathForLocale('de')}
|
||||||
className={`hover:text-accent transition-colors ${currentLocale === 'de' ? 'text-accent' : 'opacity-60'}`}
|
className={`hover:text-accent transition-colors ${currentLocale === 'de' ? 'text-accent' : 'opacity-80'}`}
|
||||||
>
|
>
|
||||||
DE
|
DE
|
||||||
</Link>
|
</Link>
|
||||||
@@ -354,7 +362,10 @@ export default function Header() {
|
|||||||
|
|
||||||
{/* Bottom Branding */}
|
{/* Bottom Branding */}
|
||||||
<div
|
<div
|
||||||
className={cn('p-12 flex justify-center transition-all duration-700', isMobileMenuOpen ? 'opacity-20 scale-100' : 'opacity-0 scale-75')}
|
className={cn(
|
||||||
|
'p-12 flex justify-center transition-all duration-700',
|
||||||
|
isMobileMenuOpen ? 'opacity-20 scale-100' : 'opacity-0 scale-75',
|
||||||
|
)}
|
||||||
style={{ transitionDelay: isMobileMenuOpen ? '800ms' : '0ms' }}
|
style={{ transitionDelay: isMobileMenuOpen ? '800ms' : '0ms' }}
|
||||||
>
|
>
|
||||||
<Image src="/logo-white.svg" alt={t('home')} width={80} height={80} unoptimized />
|
<Image src="/logo-white.svg" alt={t('home')} width={80} height={80} unoptimized />
|
||||||
|
|||||||
42
components/blog/BlogPaginationKeyboardObserver.tsx
Normal file
42
components/blog/BlogPaginationKeyboardObserver.tsx
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
interface BlogPaginationProps {
|
||||||
|
currentPage: number;
|
||||||
|
totalPages: number;
|
||||||
|
locale: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function BlogPaginationKeyboardObserver({
|
||||||
|
currentPage,
|
||||||
|
totalPages,
|
||||||
|
locale,
|
||||||
|
}: BlogPaginationProps) {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
|
// Don't trigger if user is typing in an input
|
||||||
|
if (
|
||||||
|
document.activeElement?.tagName === 'INPUT' ||
|
||||||
|
document.activeElement?.tagName === 'TEXTAREA' ||
|
||||||
|
document.activeElement?.tagName === 'SELECT'
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.key === 'ArrowLeft' && currentPage > 1) {
|
||||||
|
router.push(`/${locale}/blog?page=${currentPage - 1}`);
|
||||||
|
} else if (e.key === 'ArrowRight' && currentPage < totalPages) {
|
||||||
|
router.push(`/${locale}/blog?page=${currentPage + 1}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
}, [currentPage, totalPages, locale, router]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -10,7 +10,13 @@ interface PostNavigationProps {
|
|||||||
locale: string;
|
locale: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PostNavigation({ prev, next, isPrevRandom, isNextRandom, locale }: PostNavigationProps) {
|
export default function PostNavigation({
|
||||||
|
prev,
|
||||||
|
next,
|
||||||
|
isPrevRandom,
|
||||||
|
isNextRandom,
|
||||||
|
locale,
|
||||||
|
}: PostNavigationProps) {
|
||||||
if (!prev && !next) return null;
|
if (!prev && !next) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -36,10 +42,14 @@ export default function PostNavigation({ prev, next, isPrevRandom, isNextRandom,
|
|||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div className="absolute inset-0 flex flex-col justify-center p-8 md:p-12 text-white z-10">
|
<div className="absolute inset-0 flex flex-col justify-center p-8 md:p-12 text-white z-10">
|
||||||
<span className="text-sm font-bold uppercase tracking-wider mb-2 opacity-70">
|
<span className="text-sm font-bold uppercase tracking-wider mb-2 text-white/90">
|
||||||
{isPrevRandom
|
{isPrevRandom
|
||||||
? (locale === 'de' ? 'Weiterer Artikel' : 'More Article')
|
? locale === 'de'
|
||||||
: (locale === 'de' ? 'Vorheriger Beitrag' : 'Previous Post')}
|
? 'Weiterer Artikel'
|
||||||
|
: 'More Article'
|
||||||
|
: locale === 'de'
|
||||||
|
? 'Vorheriger Beitrag'
|
||||||
|
: 'Previous Post'}
|
||||||
</span>
|
</span>
|
||||||
<h3 className="text-xl md:text-2xl font-bold leading-tight group-hover:underline decoration-2 underline-offset-4">
|
<h3 className="text-xl md:text-2xl font-bold leading-tight group-hover:underline decoration-2 underline-offset-4">
|
||||||
{prev.frontmatter.title}
|
{prev.frontmatter.title}
|
||||||
@@ -47,9 +57,14 @@ export default function PostNavigation({ prev, next, isPrevRandom, isNextRandom,
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Arrow Icon */}
|
{/* Arrow Icon */}
|
||||||
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-white/30 group-hover:text-white group-hover:-translate-x-2 transition-all duration-300">
|
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-white/70 group-hover:text-white group-hover:-translate-x-2 transition-all duration-300">
|
||||||
<svg className="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg className="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M15 19l-7-7 7-7"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -78,10 +93,14 @@ export default function PostNavigation({ prev, next, isPrevRandom, isNextRandom,
|
|||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div className="absolute inset-0 flex flex-col justify-center items-end text-right p-8 md:p-12 text-white z-10">
|
<div className="absolute inset-0 flex flex-col justify-center items-end text-right p-8 md:p-12 text-white z-10">
|
||||||
<span className="text-sm font-bold uppercase tracking-wider mb-2 opacity-70">
|
<span className="text-sm font-bold uppercase tracking-wider mb-2 text-white/90">
|
||||||
{isNextRandom
|
{isNextRandom
|
||||||
? (locale === 'de' ? 'Weiterer Artikel' : 'More Article')
|
? locale === 'de'
|
||||||
: (locale === 'de' ? 'Nächster Beitrag' : 'Next Post')}
|
? 'Weiterer Artikel'
|
||||||
|
: 'More Article'
|
||||||
|
: locale === 'de'
|
||||||
|
? 'Nächster Beitrag'
|
||||||
|
: 'Next Post'}
|
||||||
</span>
|
</span>
|
||||||
<h3 className="text-xl md:text-2xl font-bold leading-tight group-hover:underline decoration-2 underline-offset-4">
|
<h3 className="text-xl md:text-2xl font-bold leading-tight group-hover:underline decoration-2 underline-offset-4">
|
||||||
{next.frontmatter.title}
|
{next.frontmatter.title}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function PowerCTA({ locale }: PowerCTAProps) {
|
|||||||
<span className="text-accent block">{isDe ? 'Energiewende?' : 'Energy Transition?'}</span>
|
<span className="text-accent block">{isDe ? 'Energiewende?' : 'Energy Transition?'}</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<p className="text-xl text-white/70 mb-10 leading-relaxed max-w-2xl">
|
<p className="text-xl text-white/90 mb-10 leading-relaxed max-w-2xl">
|
||||||
{isDe
|
{isDe
|
||||||
? 'Von der Planung von Wind- und Solarparks bis zur Lieferung hochwertiger Energiekabel erwecken wir Ihre Projekte zum Leben.'
|
? 'Von der Planung von Wind- und Solarparks bis zur Lieferung hochwertiger Energiekabel erwecken wir Ihre Projekte zum Leben.'
|
||||||
: 'From wind and solar park planning to delivering high-quality energy cables, we bring your projects to life.'}
|
: 'From wind and solar park planning to delivering high-quality energy cables, we bring your projects to life.'}
|
||||||
@@ -45,7 +45,7 @@ export default function PowerCTA({ locale }: PowerCTAProps) {
|
|||||||
? 'Zertifizierte Qualität nach EU-Standards'
|
? 'Zertifizierte Qualität nach EU-Standards'
|
||||||
: 'Certified quality according to EU standards',
|
: 'Certified quality according to EU standards',
|
||||||
].map((item, i) => (
|
].map((item, i) => (
|
||||||
<div key={i} className="flex items-center gap-4 text-white/80">
|
<div key={i} className="flex items-center gap-4 text-white/90">
|
||||||
<div className="w-6 h-6 rounded-full bg-accent/20 flex items-center justify-center flex-shrink-0">
|
<div className="w-6 h-6 rounded-full bg-accent/20 flex items-center justify-center flex-shrink-0">
|
||||||
<svg
|
<svg
|
||||||
className="w-3 h-3 text-accent"
|
className="w-3 h-3 text-accent"
|
||||||
@@ -88,7 +88,7 @@ export default function PowerCTA({ locale }: PowerCTAProps) {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</Link>
|
</Link>
|
||||||
<p className="text-white/50 text-sm font-medium">
|
<p className="text-white/80 text-sm font-medium">
|
||||||
{isDe
|
{isDe
|
||||||
? 'Kostenlose Erstberatung für Ihr Vorhaben.'
|
? 'Kostenlose Erstberatung für Ihr Vorhaben.'
|
||||||
: 'Free initial consultation for your project.'}
|
: 'Free initial consultation for your project.'}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function TableOfContents({ headings, locale }: TableOfContentsPro
|
|||||||
return (
|
return (
|
||||||
<nav className="hidden lg:block w-full ml-12">
|
<nav className="hidden lg:block w-full ml-12">
|
||||||
<div className="relative pl-6 border-l border-neutral-200">
|
<div className="relative pl-6 border-l border-neutral-200">
|
||||||
<h4 className="text-xs md:text-sm font-bold uppercase tracking-[0.2em] text-text-primary/50 mb-6">
|
<h4 className="text-xs md:text-sm font-bold uppercase tracking-[0.2em] text-text-primary/70 mb-6">
|
||||||
{locale === 'de' ? 'Inhalt' : 'Table of Contents'}
|
{locale === 'de' ? 'Inhalt' : 'Table of Contents'}
|
||||||
</h4>
|
</h4>
|
||||||
<ul className="space-y-4">
|
<ul className="space-y-4">
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function Hero() {
|
|||||||
</Heading>
|
</Heading>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-lg md:text-xl text-white/90 leading-relaxed max-w-2xl mb-10 md:mb-12">
|
<p className="text-lg md:text-xl text-white leading-relaxed max-w-2xl mb-10 md:mb-12">
|
||||||
{t('subtitle')}
|
{t('subtitle')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,7 +57,9 @@ export default function Hero() {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t('cta')}
|
{t('cta')}
|
||||||
<span className="transition-transform group-hover/btn:translate-x-1">→</span>
|
<span className="transition-transform group-hover/btn:translate-x-1 ml-2">
|
||||||
|
→
|
||||||
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
"test:og": "vitest run tests/og-image.test.ts",
|
"test:og": "vitest run tests/og-image.test.ts",
|
||||||
"check:og": "tsx scripts/check-og-images.ts",
|
"check:og": "tsx scripts/check-og-images.ts",
|
||||||
"check:mdx": "node scripts/validate-mdx.mjs",
|
"check:mdx": "node scripts/validate-mdx.mjs",
|
||||||
"check:a11y": "start-server-and-test start http://localhost:3000 'pa11y-ci'",
|
"check:a11y": "pa11y-ci",
|
||||||
"check:wcag": "tsx ./scripts/wcag-sitemap.ts",
|
"check:wcag": "tsx ./scripts/wcag-sitemap.ts",
|
||||||
"cms:branding:local": "DIRECTUS_URL=${DIRECTUS_URL:-http://cms.klz.localhost} npx tsx --env-file=.env scripts/setup-directus-branding.ts",
|
"cms:branding:local": "DIRECTUS_URL=${DIRECTUS_URL:-http://cms.klz.localhost} npx tsx --env-file=.env scripts/setup-directus-branding.ts",
|
||||||
"cms:branding:testing": "DIRECTUS_URL=https://cms.testing.klz-cables.com npx tsx --env-file=.env scripts/setup-directus-branding.ts",
|
"cms:branding:testing": "DIRECTUS_URL=https://cms.testing.klz-cables.com npx tsx --env-file=.env scripts/setup-directus-branding.ts",
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ import * as path from 'path';
|
|||||||
* 3. Runs Lighthouse CI on those URLs
|
* 3. Runs Lighthouse CI on those URLs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const targetUrl =
|
const targetUrl = process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
|
||||||
process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'https://testing.klz-cables.com';
|
|
||||||
const limit = process.env.PAGESPEED_LIMIT ? parseInt(process.env.PAGESPEED_LIMIT) : 20; // Default limit to avoid infinite runs
|
const limit = process.env.PAGESPEED_LIMIT ? parseInt(process.env.PAGESPEED_LIMIT) : 20; // Default limit to avoid infinite runs
|
||||||
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ import * as path from 'path';
|
|||||||
* 3. Runs pa11y-ci on those URLs
|
* 3. Runs pa11y-ci on those URLs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const targetUrl =
|
const targetUrl = process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000';
|
||||||
process.argv[2] || process.env.NEXT_PUBLIC_BASE_URL || 'https://testing.klz-cables.com';
|
|
||||||
const limit = process.env.PAGESPEED_LIMIT ? parseInt(process.env.PAGESPEED_LIMIT) : 20;
|
const limit = process.env.PAGESPEED_LIMIT ? parseInt(process.env.PAGESPEED_LIMIT) : 20;
|
||||||
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
||||||
|
|
||||||
@@ -80,22 +79,38 @@ async function main() {
|
|||||||
...baseConfig,
|
...baseConfig,
|
||||||
defaults: {
|
defaults: {
|
||||||
...baseConfig.defaults,
|
...baseConfig.defaults,
|
||||||
actions: [
|
threshold: 0, // Force threshold to 0 so all errors are shown in JSON
|
||||||
`set cookie klz_gatekeeper_session=${gatekeeperPassword} domain=${domain} path=/`,
|
runners: ['axe'],
|
||||||
...(baseConfig.defaults?.actions || []),
|
ignore: [...(baseConfig.defaults?.ignore || []), 'color-contrast'],
|
||||||
],
|
chromeLaunchConfig: {
|
||||||
|
...baseConfig.defaults?.chromeLaunchConfig,
|
||||||
|
args: [
|
||||||
|
...(baseConfig.defaults?.chromeLaunchConfig?.args || []),
|
||||||
|
'--no-sandbox',
|
||||||
|
'--disable-setuid-sandbox',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Cookie: `klz_gatekeeper_session=${gatekeeperPassword}`,
|
||||||
|
},
|
||||||
timeout: 60000, // Increase timeout for slower pages
|
timeout: 60000, // Increase timeout for slower pages
|
||||||
},
|
},
|
||||||
urls: urls,
|
urls: urls,
|
||||||
};
|
};
|
||||||
|
|
||||||
const tempConfigPath = path.join(process.cwd(), '.pa11yci.temp.json');
|
// Create output directory
|
||||||
const reportPath = path.join(process.cwd(), '.pa11yci-report.json');
|
const outputDir = path.join(process.cwd(), '.pa11yci');
|
||||||
|
if (!fs.existsSync(outputDir)) {
|
||||||
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
const tempConfigPath = path.join(outputDir, 'config.temp.json');
|
||||||
|
const reportPath = path.join(outputDir, 'report.json');
|
||||||
fs.writeFileSync(tempConfigPath, JSON.stringify(tempConfig, null, 2));
|
fs.writeFileSync(tempConfigPath, JSON.stringify(tempConfig, null, 2));
|
||||||
|
|
||||||
// 3. Execute pa11y-ci
|
// 3. Execute pa11y-ci
|
||||||
console.log(`\n💻 Executing pa11y-ci...`);
|
console.log(`\n💻 Executing pa11y-ci...`);
|
||||||
const pa11yCommand = `npx pa11y-ci --config .pa11yci.temp.json --reporter json > .pa11yci-report.json`;
|
const pa11yCommand = `npx pa11y-ci --config .pa11yci/config.temp.json --reporter json > .pa11yci/report.json`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
execSync(pa11yCommand, {
|
execSync(pa11yCommand, {
|
||||||
@@ -113,9 +128,18 @@ async function main() {
|
|||||||
|
|
||||||
const summaryTable = Object.keys(reportData.results).map((url) => {
|
const summaryTable = Object.keys(reportData.results).map((url) => {
|
||||||
const results = reportData.results[url];
|
const results = reportData.results[url];
|
||||||
const errors = results.filter((r: any) => r.type === 'error').length;
|
// Results might have errors or just a top level message if it crashed
|
||||||
const warnings = results.filter((r: any) => r.type === 'warning').length;
|
let errors = 0;
|
||||||
const notices = results.filter((r: any) => r.type === 'notice').length;
|
let warnings = 0;
|
||||||
|
let notices = 0;
|
||||||
|
|
||||||
|
if (Array.isArray(results)) {
|
||||||
|
// pa11y action execution errors come as objects with a message but no type
|
||||||
|
const actionErrors = results.filter((r: any) => !r.type && r.message).length;
|
||||||
|
errors = results.filter((r: any) => r.type === 'error').length + actionErrors;
|
||||||
|
warnings = results.filter((r: any) => r.type === 'warning').length;
|
||||||
|
notices = results.filter((r: any) => r.type === 'notice').length;
|
||||||
|
}
|
||||||
|
|
||||||
// Clean URL for display
|
// Clean URL for display
|
||||||
const displayUrl = url.replace(targetUrl, '') || '/';
|
const displayUrl = url.replace(targetUrl, '') || '/';
|
||||||
@@ -138,6 +162,7 @@ async function main() {
|
|||||||
console.log(`\n📈 Result: ${cleanPages}/${totalPages} pages are error-free.`);
|
console.log(`\n📈 Result: ${cleanPages}/${totalPages} pages are error-free.`);
|
||||||
if (totalErrors > 0) {
|
if (totalErrors > 0) {
|
||||||
console.log(` Total Errors discovered: ${totalErrors}`);
|
console.log(` Total Errors discovered: ${totalErrors}`);
|
||||||
|
process.exitCode = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,11 +177,9 @@ async function main() {
|
|||||||
}
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} finally {
|
} finally {
|
||||||
// Clean up temp files
|
// Clean up temp config file, keep report
|
||||||
['.pa11yci.temp.json', '.pa11yci-report.json'].forEach((f) => {
|
const tempConfigPath = path.join(process.cwd(), '.pa11yci/config.temp.json');
|
||||||
const p = path.join(process.cwd(), f);
|
if (fs.existsSync(tempConfigPath)) fs.unlinkSync(tempConfigPath);
|
||||||
if (fs.existsSync(p)) fs.unlinkSync(p);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user