feat: SEO altyapısı + admin editör/favicon/menü düzeltmeleri
Admin & site: - @tailwindcss/typography ekle → editör ve yayın içeriği prose stilleriyle düzgün render - Favicon: logo.png'den kare app/icon.png + apple-icon.png, varsayılan favicon.ico kaldırıldı - SEO keyword: seo_settings.default_keywords + seo_pages.keywords + buildMetadata birleştirme - Menü düzeni admin'den yönetilebilir (site_settings.nav_items, /admin/menu, header & mobile-menu refactor) SEO: - app/sitemap.ts (statik + blog/hizmet/çözüm/proje/sektör dinamik) - app/robots.ts (sitemap ref + /admin,/api disallow) - app/llms.txt/route.ts (AI/LLM rehberi) - BlogPosting/Service/FAQ/Article JSON-LD wire (json-ld bileşenleri bağlandı) - buildMetadata: blog/proje OG görseli + type article + keywords birleştirme düzeltmesi - blog tags → keyword
This commit is contained in:
@@ -6,6 +6,7 @@ import { ArrowLeft, Calendar } from "lucide-react";
|
||||
import { renderContent } from "@/lib/content-render";
|
||||
import { getPostBySlug } from "@/lib/data";
|
||||
import { buildMetadata } from "@/lib/seo";
|
||||
import { BlogPostingLd } from "@/components/json-ld";
|
||||
import { ContentSidebar } from "@/components/content-sidebar";
|
||||
|
||||
export async function generateMetadata({
|
||||
@@ -19,6 +20,7 @@ export async function generateMetadata({
|
||||
return buildMetadata(`/blog/${slug}`, {
|
||||
title: post.seo_title || post.title,
|
||||
description: post.seo_description || post.excerpt || undefined,
|
||||
keywords: post.tags ?? undefined,
|
||||
openGraph: {
|
||||
title: post.seo_title || post.title,
|
||||
description: post.seo_description || post.excerpt || undefined,
|
||||
@@ -44,6 +46,7 @@ export default async function BlogPostPage({
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-7xl px-6 py-16">
|
||||
<BlogPostingLd post={post} />
|
||||
<Link
|
||||
href="/blog"
|
||||
className="inline-flex items-center gap-1 text-sm text-[var(--muted)] hover:text-[var(--navy)]"
|
||||
|
||||
@@ -9,6 +9,7 @@ import { SectionTitle } from "@/components/section-title";
|
||||
import { FaqList } from "@/components/faq-list";
|
||||
import { ServiceHero } from "@/components/service-hero";
|
||||
import { ServiceSidebar } from "@/components/service-sidebar";
|
||||
import { ServiceLd, FaqLd } from "@/components/json-ld";
|
||||
import type { FaqItem } from "@/lib/types";
|
||||
|
||||
export async function generateMetadata({
|
||||
@@ -59,6 +60,8 @@ export default async function ServiceDetailPage({
|
||||
|
||||
return (
|
||||
<>
|
||||
<ServiceLd service={service} settings={settings} />
|
||||
<FaqLd items={faqItems} />
|
||||
<ServiceHero service={service} settings={settings} />
|
||||
|
||||
<div className="mx-auto grid max-w-7xl gap-12 px-6 py-16 lg:grid-cols-[1.5fr_1fr]">
|
||||
|
||||
@@ -7,6 +7,7 @@ import { renderContent } from "@/lib/content-render";
|
||||
import { getProjectBySlug, listProjects } from "@/lib/data";
|
||||
import { buildMetadata } from "@/lib/seo";
|
||||
import { Gallery } from "@/components/gallery";
|
||||
import { ArticleLd } from "@/components/json-ld";
|
||||
import { TrendingUp } from "lucide-react";
|
||||
import type { ProjectMetric } from "@/lib/types";
|
||||
|
||||
@@ -74,6 +75,7 @@ export default async function ProjectDetailPage({
|
||||
|
||||
return (
|
||||
<>
|
||||
<ArticleLd post={project} />
|
||||
<section className="border-b border-[var(--border)]">
|
||||
<div className="mx-auto max-w-7xl px-6 py-12">
|
||||
<Link
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import {
|
||||
ArrowDown,
|
||||
ArrowUp,
|
||||
Eye,
|
||||
EyeOff,
|
||||
GripVertical,
|
||||
Save,
|
||||
} from "lucide-react";
|
||||
import {
|
||||
FormActions,
|
||||
FormShell,
|
||||
PrimaryButton,
|
||||
} from "@/components/admin/form";
|
||||
import { saveNavMenu } from "@/lib/admin-actions";
|
||||
import { serializeNavItems, type NavItem } from "@/lib/nav";
|
||||
|
||||
export function MenuForm({ initial }: { initial: NavItem[] }) {
|
||||
const [items, setItems] = useState<NavItem[]>(initial);
|
||||
|
||||
function move(index: number, dir: -1 | 1) {
|
||||
const target = index + dir;
|
||||
if (target < 0 || target >= items.length) return;
|
||||
setItems((prev) => {
|
||||
const next = [...prev];
|
||||
[next[index], next[target]] = [next[target], next[index]];
|
||||
return next;
|
||||
});
|
||||
}
|
||||
|
||||
function toggleVisible(index: number) {
|
||||
setItems((prev) =>
|
||||
prev.map((it, i) =>
|
||||
i === index ? { ...it, visible: !it.visible } : it,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function setLabel(index: number, value: string) {
|
||||
setItems((prev) =>
|
||||
prev.map((it, i) => (i === index ? { ...it, label: value } : it)),
|
||||
);
|
||||
}
|
||||
|
||||
const payload = serializeNavItems(
|
||||
items.map((i) => ({ key: i.key, visible: i.visible, label: i.label })),
|
||||
);
|
||||
|
||||
return (
|
||||
<form action={saveNavMenu}>
|
||||
<input type="hidden" name="nav_items" value={payload} />
|
||||
<FormShell>
|
||||
<ul className="space-y-2">
|
||||
{items.map((item, i) => (
|
||||
<li
|
||||
key={item.key}
|
||||
className={`flex items-center gap-3 rounded-xl border border-[var(--border)] bg-white px-3 py-2.5 ${
|
||||
item.visible ? "" : "opacity-50"
|
||||
}`}
|
||||
>
|
||||
<GripVertical className="size-4 shrink-0 text-[var(--muted)]" />
|
||||
|
||||
<div className="flex shrink-0 flex-col">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => move(i, -1)}
|
||||
disabled={i === 0}
|
||||
aria-label="Yukarı taşı"
|
||||
className="text-[var(--muted)] transition hover:text-[var(--navy)] disabled:opacity-30"
|
||||
>
|
||||
<ArrowUp className="size-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => move(i, 1)}
|
||||
disabled={i === items.length - 1}
|
||||
aria-label="Aşağı taşı"
|
||||
className="text-[var(--muted)] transition hover:text-[var(--navy)] disabled:opacity-30"
|
||||
>
|
||||
<ArrowDown className="size-4" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<input
|
||||
value={item.label}
|
||||
onChange={(e) => setLabel(i, e.target.value)}
|
||||
className="min-w-0 flex-1 rounded-lg border border-[var(--border)] bg-white px-3 py-1.5 text-sm outline-none transition focus:border-[var(--sky)] focus:ring-2 focus:ring-[var(--sky)]/20"
|
||||
/>
|
||||
|
||||
<span className="shrink-0 font-mono text-xs text-[var(--muted)]">
|
||||
{item.href}
|
||||
</span>
|
||||
|
||||
{item.mega && (
|
||||
<span className="shrink-0 rounded-full bg-[var(--navy-50)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-[var(--navy)]">
|
||||
Mega menü
|
||||
</span>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => toggleVisible(i)}
|
||||
aria-label={item.visible ? "Gizle" : "Göster"}
|
||||
title={item.visible ? "Menüde görünür" : "Menüde gizli"}
|
||||
className={`inline-flex size-8 shrink-0 items-center justify-center rounded-lg transition ${
|
||||
item.visible
|
||||
? "bg-[var(--navy)] text-white"
|
||||
: "border border-[var(--border)] text-[var(--muted)] hover:text-[var(--navy)]"
|
||||
}`}
|
||||
>
|
||||
{item.visible ? (
|
||||
<Eye className="size-4" />
|
||||
) : (
|
||||
<EyeOff className="size-4" />
|
||||
)}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p className="mt-3 text-xs text-[var(--muted)]">
|
||||
Sıralama ok tuşlarıyla değişir. Göz simgesiyle bir öğeyi menüden
|
||||
gizleyebilirsiniz. “Hizmetler” öğesi mega menü olarak
|
||||
açılır.
|
||||
</p>
|
||||
|
||||
<FormActions>
|
||||
<PrimaryButton>
|
||||
<Save className="size-4" /> Menüyü kaydet
|
||||
</PrimaryButton>
|
||||
</FormActions>
|
||||
</FormShell>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { PageHeader } from "@/components/admin/form";
|
||||
import { getSiteSettings } from "@/lib/data";
|
||||
import { resolveNavItems } from "@/lib/nav";
|
||||
import { MenuForm } from "./form";
|
||||
|
||||
export default async function MenuAdminPage() {
|
||||
const settings = await getSiteSettings();
|
||||
const items = resolveNavItems(settings?.nav_items);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
title="Menü düzeni"
|
||||
description="Üst menü öğelerinin sırasını ve görünürlüğünü düzenleyin. Etiketi boş bırakırsanız varsayılan kullanılır."
|
||||
/>
|
||||
<MenuForm initial={items} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -40,6 +40,14 @@ export function SeoPageForm({ row }: { row?: SeoPageRow }) {
|
||||
rows={3}
|
||||
defaultValue={row?.description}
|
||||
/>
|
||||
<Textarea
|
||||
label="Anahtar kelimeler"
|
||||
name="keywords"
|
||||
rows={2}
|
||||
defaultValue={row?.keywords}
|
||||
placeholder="web tasarım, kurumsal site, kocaeli"
|
||||
help="Virgülle ayırın. Bu sayfaya özel; site geneli kelimelerle birleştirilir."
|
||||
/>
|
||||
<MediaPicker
|
||||
label="OG görseli"
|
||||
name="og_image"
|
||||
|
||||
@@ -97,6 +97,17 @@ export default async function SeoAdminPage() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-5">
|
||||
<Textarea
|
||||
label="Anahtar kelimeler (site geneli)"
|
||||
name="default_keywords"
|
||||
rows={2}
|
||||
defaultValue={settings?.default_keywords}
|
||||
placeholder="yazılım geliştirme, web tasarım kocaeli, crm çözümleri, e-ticaret izmit"
|
||||
help="Virgülle ayırın. Tüm sayfalarda varsayılan olarak kullanılır; sayfa override ile birleştirilir."
|
||||
/>
|
||||
</div>
|
||||
|
||||
<FormActions>
|
||||
<PrimaryButton>
|
||||
<Save className="size-4" /> Global ayarları kaydet
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -1,4 +1,5 @@
|
||||
@import "tailwindcss";
|
||||
@plugin "@tailwindcss/typography";
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
+2
-1
@@ -30,7 +30,8 @@ export const metadata: Metadata = {
|
||||
locale: "tr_TR",
|
||||
type: "website",
|
||||
},
|
||||
icons: { icon: "/logo.png" },
|
||||
// Favicon/app ikonları app/icon.png + app/apple-icon.png dosya
|
||||
// konvansiyonundan otomatik üretilir (logo.png'den kare kırpıldı).
|
||||
};
|
||||
|
||||
export default async function RootLayout({
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
import { siteConfig } from "@/lib/site-config";
|
||||
import {
|
||||
getSeoSettings,
|
||||
getSiteSettings,
|
||||
listIndustries,
|
||||
listProjects,
|
||||
listPublishedPosts,
|
||||
listServices,
|
||||
listSolutions,
|
||||
} from "@/lib/data";
|
||||
|
||||
// AI/LLM'lerin (ChatGPT, Perplexity, Claude, Google AI Overviews vb.) siteyi
|
||||
// hızlı ve doğru anlaması için /llms.txt rehberi.
|
||||
// Spec: https://llmstxt.org
|
||||
|
||||
export const revalidate = 3600;
|
||||
|
||||
const BASE = siteConfig.url;
|
||||
|
||||
function section(title: string, lines: string[]): string {
|
||||
if (lines.length === 0) return "";
|
||||
return `## ${title}\n\n${lines.join("\n")}\n`;
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
const [seo, site, services, solutions, posts, industries] = await Promise.all([
|
||||
getSeoSettings(),
|
||||
getSiteSettings(),
|
||||
listServices(),
|
||||
listSolutions(),
|
||||
listPublishedPosts({ limit: 30 }),
|
||||
listIndustries(),
|
||||
]);
|
||||
|
||||
const name = seo?.site_name || siteConfig.name;
|
||||
const summary =
|
||||
seo?.site_description || site?.footer_tagline || siteConfig.tagline;
|
||||
const phone = site?.contact_phone || siteConfig.contact.phone;
|
||||
const email = site?.contact_email || siteConfig.contact.email;
|
||||
const address = site?.contact_address || siteConfig.contact.address;
|
||||
|
||||
const link = (title: string, path: string, desc?: string) =>
|
||||
`- [${title}](${BASE}${path})${desc ? `: ${desc}` : ""}`;
|
||||
|
||||
const body = [
|
||||
`# ${name}`,
|
||||
"",
|
||||
`> ${summary}`,
|
||||
"",
|
||||
`${name}, Kocaeli/İzmit merkezli; yazılım geliştirme, web tasarım, e-ticaret, mobil uygulama, CRM ve dijital pazarlama hizmetleri sunar. İletişim: ${phone} · ${email} · ${address}`,
|
||||
"",
|
||||
section("Ana Sayfalar", [
|
||||
link("Anasayfa", "/"),
|
||||
link("Hizmetler", "/hizmetler", "Tüm hizmetlerin listesi"),
|
||||
link("Çözümler", "/cozumler", "Paket çözümler"),
|
||||
link("Projeler", "/projeler", "Portföy ve vaka çalışmaları"),
|
||||
link("Blog", "/blog", "Rehber içerikler ve yazılar"),
|
||||
link("Hakkımızda", "/hakkimizda"),
|
||||
link("İletişim", "/iletisim"),
|
||||
]),
|
||||
section(
|
||||
"Hizmetler",
|
||||
services.map((s) =>
|
||||
link(s.title, `/hizmetler/${s.slug}`, s.description ?? undefined),
|
||||
),
|
||||
),
|
||||
section(
|
||||
"Çözümler",
|
||||
solutions.map((s) =>
|
||||
link(s.title, `/cozumler/${s.slug}`, s.description ?? undefined),
|
||||
),
|
||||
),
|
||||
section(
|
||||
"Sektörler",
|
||||
industries.map((i) =>
|
||||
link(i.title, `/sektor/${i.slug}`, i.subtitle ?? undefined),
|
||||
),
|
||||
),
|
||||
section(
|
||||
"Blog Yazıları",
|
||||
posts.map((p) =>
|
||||
link(p.title, `/blog/${p.slug}`, p.excerpt ?? undefined),
|
||||
),
|
||||
),
|
||||
section("Kaynaklar", [link("Site haritası", "/sitemap.xml")]),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
|
||||
return new Response(body, {
|
||||
headers: {
|
||||
"Content-Type": "text/plain; charset=utf-8",
|
||||
"Cache-Control": "public, max-age=0, s-maxage=3600, stale-while-revalidate=86400",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { siteConfig } from "@/lib/site-config";
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
rules: {
|
||||
userAgent: "*",
|
||||
allow: "/",
|
||||
disallow: ["/admin", "/api"],
|
||||
},
|
||||
sitemap: `${siteConfig.url}/sitemap.xml`,
|
||||
host: siteConfig.url,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { siteConfig } from "@/lib/site-config";
|
||||
import {
|
||||
listIndustries,
|
||||
listProjects,
|
||||
listPublishedPosts,
|
||||
listServices,
|
||||
listSolutions,
|
||||
} from "@/lib/data";
|
||||
|
||||
const BASE = siteConfig.url;
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
const [posts, services, solutions, projects, industries] = await Promise.all([
|
||||
listPublishedPosts({ limit: 200 }),
|
||||
listServices(),
|
||||
listSolutions(),
|
||||
listProjects({ limit: 200 }),
|
||||
listIndustries(),
|
||||
]);
|
||||
|
||||
const staticRoutes: MetadataRoute.Sitemap = [
|
||||
{ url: `${BASE}/`, changeFrequency: "weekly", priority: 1 },
|
||||
{ url: `${BASE}/hizmetler`, changeFrequency: "monthly", priority: 0.9 },
|
||||
{ url: `${BASE}/cozumler`, changeFrequency: "monthly", priority: 0.9 },
|
||||
{ url: `${BASE}/projeler`, changeFrequency: "monthly", priority: 0.8 },
|
||||
{ url: `${BASE}/blog`, changeFrequency: "daily", priority: 0.8 },
|
||||
{ url: `${BASE}/hakkimizda`, changeFrequency: "yearly", priority: 0.6 },
|
||||
{ url: `${BASE}/iletisim`, changeFrequency: "yearly", priority: 0.7 },
|
||||
{ url: `${BASE}/site-analizi`, changeFrequency: "yearly", priority: 0.6 },
|
||||
{ url: `${BASE}/cerez-politikasi`, changeFrequency: "yearly", priority: 0.2 },
|
||||
];
|
||||
|
||||
const toEntry = (
|
||||
path: string,
|
||||
updatedAt?: string,
|
||||
priority = 0.7,
|
||||
): MetadataRoute.Sitemap[number] => ({
|
||||
url: `${BASE}${path}`,
|
||||
lastModified: updatedAt ? new Date(updatedAt) : undefined,
|
||||
changeFrequency: "weekly",
|
||||
priority,
|
||||
});
|
||||
|
||||
return [
|
||||
...staticRoutes,
|
||||
...posts.map((p) => toEntry(`/blog/${p.slug}`, p.$updatedAt, 0.7)),
|
||||
...services.map((s) => toEntry(`/hizmetler/${s.slug}`, s.$updatedAt, 0.8)),
|
||||
...solutions.map((s) => toEntry(`/cozumler/${s.slug}`, s.$updatedAt, 0.8)),
|
||||
...projects.map((p) => toEntry(`/projeler/${p.slug}`, p.$updatedAt, 0.7)),
|
||||
...industries.map((i) => toEntry(`/sektor/${i.slug}`, i.$updatedAt, 0.6)),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user