Files
Laboratorium_AI_site/src/app/page.jsx
T
Paweł Domański 8d4dc8a6f1 Strony artykułów, sitemap, GA4, polityka prywatności
- Klikalne kafelki i slideshow → /blog/[slug]
- Strona artykułu: cover fullwidth z parallax, tytuł nad obrazkiem
- Schema.org BlogPosting na stronach postów
- Dynamiczny sitemap.xml (artykuły + produkty z Directus, revalidate=0)
- Google Analytics GA4 (G-7067BL7TDN)
- Polityka prywatności /polityka-prywatnosci
- CookieBanner z linkiem do polityki
- Footer: działający link do polityki prywatności

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-07-05 19:49:19 +02:00

96 lines
3.1 KiB
React

import Hero from '../sections/Hero'
import Benefits from '../sections/Benefits'
import ProductsPreview from '../sections/ProductsPreview'
import BentoCard from '../components/BentoCard'
import BentoSlideshow from '../components/BentoSlideshow'
import SubscribeBox from '../components/SubscribeBox'
import { fetchLaboratoriumData, mapDirectusToContent } from '../lib/directus'
import { newsData, videosData } from '../data/content'
export const revalidate = 0
async function getContent() {
try {
const items = await fetchLaboratoriumData()
return mapDirectusToContent(items)
} catch {
return null
}
}
export default async function HomePage() {
const content = await getContent()
return (
<>
<Hero />
<Benefits />
<ProductsPreview />
<div className="page-wrapper">
<main className="bento-area" aria-label="Artykuły">
{!content ? (
<p style={{ gridColumn: '1 / 5', padding: '4rem', textAlign: 'center', color: '#888' }}>
W tej chwili brak wpisów.
</p>
) : (
<>
<BentoSlideshow
slides={content.slideshow}
style={{ gridColumn: '1 / 5', gridRow: '1 / 2' }}
/>
{content.articles.map((article, index) => (
<BentoCard
key={index}
type={article.type}
badge={article.badge}
title={article.title}
category={article.category}
readTime={article.readTime}
bgImage={article.bgImage}
hero={article.hero}
style={{ gridColumn: article.gridColumn, gridRow: article.gridRow }}
href={article.slug ? `/blog/${article.slug}` : undefined}
/>
))}
</>
)}
</main>
<aside className="sidebar sidebar-right" aria-label="Najnowsze wideo">
<div>
<h3 className="sidebar-title">LATEST VIDEOS</h3>
{videosData.map((video, index) => (
<div key={index} className="video-item" tabIndex={0}>
<div
className="video-thumb"
style={{ backgroundImage: `url(${video.bgImage})` }}
role="img"
aria-label={video.title}
/>
<div className="video-info">
<div className="video-title">{video.title}</div>
<div className="video-views">{video.views}</div>
</div>
</div>
))}
</div>
<SubscribeBox />
<div style={{ marginTop: '2rem' }}>
<h3 className="sidebar-title">LATEST AI NEWS</h3>
<div className="news-list">
{newsData.map((item, index) => (
<div key={index} className="news-item" tabIndex={0}>
<div className="news-time">{item.time}</div>
<div className="news-title">{item.title}</div>
</div>
))}
</div>
</div>
</aside>
</div>
</>
)
}