feat: add privacy hub and application privacy subpages

This commit is contained in:
mstfyldz
2026-08-17 10:29:12 +03:00
parent 59b2afbc5a
commit 39b19bdee9
11 changed files with 1536 additions and 2 deletions
+71
View File
@@ -0,0 +1,71 @@
import { notFound } from "next/navigation";
import { getDictionary } from "@/get-dictionary";
import { i18n, type Locale } from "@/i18n-config";
import PrivacyDetailClient from "@/components/PrivacyDetailClient";
import { getAllPrivacyApps, getPrivacyAppBySlug } from "@/data/privacy";
export async function generateStaticParams() {
const paths: Array<{ lang: Locale; slug: string }> = [];
const apps = getAllPrivacyApps();
for (const lang of i18n.locales) {
for (const app of apps) {
paths.push({ lang, slug: app.slug });
}
}
return paths;
}
export async function generateMetadata({
params,
}: {
params: Promise<{ lang: Locale; slug: string }>;
}) {
const { lang, slug } = await params;
const app = getPrivacyAppBySlug(slug);
if (!app) {
return {
title: lang === "tr" ? "Gizlilik Politikası Bulunamadı" : "Privacy Policy Not Found",
};
}
const isTr = lang === "tr";
return {
title: isTr
? `${app.name} Gizlilik Politikası & Veri Güvenliği | Ayris Tech`
: `${app.name} Privacy Policy & Data Security | Ayris Tech`,
description: app.summary[lang],
alternates: {
canonical: `/${lang}/privacy/${app.slug}`,
},
};
}
export default async function PrivacyDetailPage({
params,
}: {
params: Promise<{ lang: Locale; slug: string }>;
}) {
const { lang, slug } = await params;
const dict = await getDictionary(lang);
const app = getPrivacyAppBySlug(slug);
if (!app) {
notFound();
}
const allApps = getAllPrivacyApps();
const otherApps = allApps.filter((a) => a.slug !== app.slug);
return (
<PrivacyDetailClient
lang={lang}
dict={dict}
app={app}
otherApps={otherApps}
/>
);
}
+38
View File
@@ -0,0 +1,38 @@
import { getDictionary } from "@/get-dictionary";
import type { Locale } from "@/i18n-config";
import PrivacyClient from "@/components/PrivacyClient";
import { getAllPrivacyApps } from "@/data/privacy";
export async function generateMetadata({
params,
}: {
params: Promise<{ lang: Locale }>;
}) {
const { lang } = await params;
const dict = await getDictionary(lang);
const isTr = lang === "tr";
return {
title: isTr
? "Gizlilik Politikaları & Veri Güvenliği | Ayris Tech"
: "Privacy Policies & Data Compliance | Ayris Tech",
description: isTr
? "Ayris Tech mobil uygulamaları, bulut servisleri ve web platformlarının şeffaf gizlilik politikaları, KVKK ve GDPR uyum ilkeleri."
: "Transparent privacy policies, hardware permissions, and data protection compliance for all Ayris Tech applications and cloud services.",
alternates: {
canonical: `/${lang}/privacy`,
},
};
}
export default async function PrivacyPage({
params,
}: {
params: Promise<{ lang: Locale }>;
}) {
const { lang } = await params;
const dict = await getDictionary(lang);
const apps = getAllPrivacyApps();
return <PrivacyClient lang={lang} dict={dict} apps={apps} />;
}
+36 -1
View File
@@ -48,6 +48,18 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
changeFrequency: 'monthly',
priority: 0.8,
},
{
url: `${baseUrl}/en/privacy`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.7,
},
{
url: `${baseUrl}/tr/privacy`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.7,
},
];
try {
@@ -111,7 +123,30 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
// Ignore if blog fetching fails
}
return [...staticUrls, ...expertiseUrls, ...workUrls, ...blogUrls];
// Privacy App Pages
let privacyUrls: MetadataRoute.Sitemap = [];
try {
const { getAllPrivacyApps } = await import('@/data/privacy');
const privacyApps = getAllPrivacyApps();
privacyUrls = privacyApps.flatMap((app) => [
{
url: `${baseUrl}/en/privacy/${app.slug}`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.6,
},
{
url: `${baseUrl}/tr/privacy/${app.slug}`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.6,
},
]);
} catch (err) {
// Ignore if privacy fetching fails
}
return [...staticUrls, ...expertiseUrls, ...workUrls, ...blogUrls, ...privacyUrls];
} catch(e) {
return staticUrls;
}