Update routing in next.config.ts to redirect "/tercih-robotu" to the hero form, add simple-icons dependency in package.json, and enhance database indexing for improved query performance. Remove unused SVG files and update metadata across various pages for better SEO and clarity.
All checks were successful
Deploy / deploy (push) Successful in 14m14s
All checks were successful
Deploy / deploy (push) Successful in 14m14s
This commit is contained in:
124
src/lib/seo.tsx
Normal file
124
src/lib/seo.tsx
Normal file
@@ -0,0 +1,124 @@
|
||||
import { URUNLER } from "./credits";
|
||||
|
||||
/**
|
||||
* Kanonik site adresi. NEXT_PUBLIC_APP_URL bilinçli olarak KULLANILMAZ —
|
||||
* o değişken ödeme callback akışına ait ve .env.local'de localhost'a işaret
|
||||
* ediyor. .dockerignore .env* dosyalarını dışladığı için prod build burada
|
||||
* deterministik olarak kolaytercih.com'a düşer.
|
||||
*/
|
||||
export const SITE_URL =
|
||||
process.env.NEXT_PUBLIC_SITE_URL ??
|
||||
(process.env.NODE_ENV === "production"
|
||||
? "https://kolaytercih.com"
|
||||
: "http://localhost:3000");
|
||||
|
||||
export const SITE_NAME = "KolayTercih";
|
||||
|
||||
type JsonLdData = Record<string, unknown>;
|
||||
|
||||
export function organizationJsonLd(): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
logo: `${SITE_URL}/kolay-tercih-mark.svg`,
|
||||
contactPoint: {
|
||||
"@type": "ContactPoint",
|
||||
email: "destek@kolaytercih.com",
|
||||
contactType: "customer support",
|
||||
availableLanguage: "Turkish",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function webSiteJsonLd(): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
inLanguage: "tr",
|
||||
};
|
||||
}
|
||||
|
||||
export function softwareApplicationJsonLd(): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "SoftwareApplication",
|
||||
name: SITE_NAME,
|
||||
applicationCategory: "EducationalApplication",
|
||||
operatingSystem: "Web",
|
||||
url: SITE_URL,
|
||||
inLanguage: "tr",
|
||||
offers: {
|
||||
"@type": "Offer",
|
||||
price: (URUNLER.paket.amountKurus / 100).toFixed(0),
|
||||
priceCurrency: "TRY",
|
||||
description: URUNLER.paket.label,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function faqPageJsonLd(
|
||||
faqs: readonly { question: string; answer: string }[],
|
||||
): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "FAQPage",
|
||||
mainEntity: faqs.map((f) => ({
|
||||
"@type": "Question",
|
||||
name: f.question,
|
||||
acceptedAnswer: { "@type": "Answer", text: f.answer },
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function breadcrumbJsonLd(
|
||||
items: readonly { name: string; path: string }[],
|
||||
): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
itemListElement: items.map((item, i) => ({
|
||||
"@type": "ListItem",
|
||||
position: i + 1,
|
||||
name: item.name,
|
||||
item: `${SITE_URL}${item.path}`,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function articleJsonLd(opts: {
|
||||
title: string;
|
||||
description: string;
|
||||
path: string;
|
||||
datePublished: string;
|
||||
}): JsonLdData {
|
||||
return {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
headline: opts.title,
|
||||
description: opts.description,
|
||||
url: `${SITE_URL}${opts.path}`,
|
||||
datePublished: opts.datePublished,
|
||||
inLanguage: "tr",
|
||||
publisher: {
|
||||
"@type": "Organization",
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/** JSON-LD'yi güvenli gömer: `<` kaçışı script-injection'ı engeller. */
|
||||
export function JsonLd({ data }: { data: JsonLdData }) {
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(data).replace(/</g, "\\u003c"),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user