f833d429fc
Backend altyapısı: - 4 yeni Appwrite tablosu: blog_posts, testimonials, seo_pages, seo_settings - Appwrite Storage bucket: kovak-yazilim-media (görsel yüklemeleri) - Appwrite Auth ile session cookie tabanlı koruma Admin paneli (/admin): - Login akışı (email/password) + protected layout - Dashboard: sayım kartları + hızlı aksiyonlar - Blog CRUD: markdown content, kapak görseli, draft/published, SEO alanları - Services CRUD: lucide ikon seçici - Projects CRUD: teknoloji etiketleri, live URL - Testimonials CRUD: puanlama - SEO yöneticisi: global ayarlar + sayfa bazlı override - Mesaj inbox: status filtreleme + güncelleme - Medya kütüphanesi: Appwrite Storage upload/delete Public: - /blog ve /blog/[slug] sayfaları (markdown render) - Anasayfaya Testimonials bölümü - Tüm public sayfalarda generateMetadata + seo_pages override - Header'a Blog linki Route yapısı: - app/(site)/ — public site, Header/Footer ortak - app/admin/login — auth dışı - app/admin/(protected)/ — requireUser() korumalı 23 route üretiliyor, public static, admin dynamic.
85 lines
3.3 KiB
TypeScript
85 lines
3.3 KiB
TypeScript
import Image from "next/image";
|
||
import Link from "next/link";
|
||
import type { Metadata } from "next";
|
||
import { ArrowRight, Calendar } from "lucide-react";
|
||
import { SectionTitle } from "@/components/section-title";
|
||
import { listPublishedPosts } from "@/lib/data";
|
||
import { buildMetadata } from "@/lib/seo";
|
||
|
||
export async function generateMetadata(): Promise<Metadata> {
|
||
return buildMetadata("/blog", {
|
||
title: "Blog",
|
||
description: "Yazılım, web tasarım, SEO ve dijital pazarlama üzerine yazılar.",
|
||
});
|
||
}
|
||
|
||
export default async function BlogIndex() {
|
||
const posts = await listPublishedPosts();
|
||
|
||
return (
|
||
<div className="mx-auto max-w-7xl px-6 py-20">
|
||
<SectionTitle
|
||
eyebrow="Blog"
|
||
title="Yazılım, tasarım ve büyüme üzerine"
|
||
description="Sektörden notlar, vaka çalışmaları ve teknik rehberler."
|
||
/>
|
||
|
||
<div className="mt-14">
|
||
{posts.length === 0 ? (
|
||
<div className="rounded-2xl border border-dashed border-[var(--border)] bg-[var(--navy-50)]/40 p-12 text-center">
|
||
<p className="text-sm text-[var(--muted)]">
|
||
Henüz yayınlanmış yazı yok.
|
||
</p>
|
||
</div>
|
||
) : (
|
||
<div className="grid gap-8 md:grid-cols-2 lg:grid-cols-3">
|
||
{posts.map((p) => (
|
||
<article
|
||
key={p.$id}
|
||
className="group overflow-hidden rounded-2xl border border-[var(--border)] bg-white transition hover:shadow-lg"
|
||
>
|
||
<Link href={`/blog/${p.slug}`}>
|
||
<div className="relative aspect-video overflow-hidden bg-[var(--navy-50)]">
|
||
{p.cover_image ? (
|
||
<Image
|
||
src={p.cover_image}
|
||
alt={p.title}
|
||
fill
|
||
sizes="(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw"
|
||
className="object-cover transition group-hover:scale-105"
|
||
/>
|
||
) : (
|
||
<div className="flex h-full items-center justify-center text-3xl font-bold text-[var(--navy)]/30">
|
||
{p.title.charAt(0)}
|
||
</div>
|
||
)}
|
||
</div>
|
||
<div className="p-6">
|
||
<p className="flex items-center gap-1.5 text-xs text-[var(--muted)]">
|
||
<Calendar className="size-3.5" />
|
||
{p.published_at
|
||
? new Date(p.published_at).toLocaleDateString("tr-TR")
|
||
: "—"}
|
||
</p>
|
||
<h3 className="mt-2 text-lg font-semibold text-[var(--navy)] group-hover:text-[var(--sky-600)]">
|
||
{p.title}
|
||
</h3>
|
||
{p.excerpt && (
|
||
<p className="mt-2 text-sm leading-relaxed text-[var(--muted)] line-clamp-3">
|
||
{p.excerpt}
|
||
</p>
|
||
)}
|
||
<span className="mt-4 inline-flex items-center gap-1 text-sm font-medium text-[var(--sky-600)]">
|
||
Devamını oku <ArrowRight className="size-3.5" />
|
||
</span>
|
||
</div>
|
||
</Link>
|
||
</article>
|
||
))}
|
||
</div>
|
||
)}
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|