154 lines
6.1 KiB
TypeScript
154 lines
6.1 KiB
TypeScript
import type { Metadata } from "next";
|
||
import { Martian_Mono } from "next/font/google";
|
||
import "./globals.css";
|
||
import ClientWrapper from "@/components/ClientWrapper";
|
||
|
||
const martianMono = Martian_Mono({
|
||
variable: "--font-martian",
|
||
subsets: ["latin"],
|
||
weight: ["100", "200", "300", "400", "500", "600", "700", "800"],
|
||
});
|
||
|
||
import sql from "@/lib/db";
|
||
|
||
export async function generateMetadata(): Promise<Metadata> {
|
||
let settings: any = null;
|
||
try {
|
||
const result = await sql`SELECT site_name, site_description FROM settings WHERE id = 1 LIMIT 1`;
|
||
if (result.length > 0) settings = result[0];
|
||
} catch (e) {
|
||
console.error(e);
|
||
}
|
||
const siteName = settings?.site_name || "Muğla Dijital Medya Ajansı";
|
||
const siteDesc = settings?.site_description || "Muğla Dijital Medya Ajansı olarak sosyal medya yönetimi, reklam yönetimi, SEO, web tasarım ve dijital pazarlama çözümleriyle markanızı öne çıkarıyoruz.";
|
||
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "https://mugladijitalmedya.com";
|
||
|
||
return {
|
||
metadataBase: new URL(baseUrl),
|
||
title: {
|
||
default: "Muğla Dijital | Medya & Prodüksiyon Ajansı",
|
||
template: "%s | Muğla Dijital"
|
||
},
|
||
description: "Muğla'nın öncü dijital medya ajansı. Drone çekimi, sosyal medya yönetimi ve profesyonel reklam çözümleri.",
|
||
authors: [{ name: "Muğla Dijital" }],
|
||
creator: "Muğla Dijital",
|
||
publisher: "Muğla Dijital",
|
||
alternates: {
|
||
canonical: "/",
|
||
},
|
||
openGraph: {
|
||
type: "website",
|
||
locale: "tr_TR",
|
||
url: "https://mugladijitalmedya.com",
|
||
siteName: "Muğla Dijital",
|
||
title: "Muğla Dijital | Medya & Prodüksiyon Ajansı",
|
||
description: "Profesyonel drone çekimi ve dijital medya çözümleri.",
|
||
images: [
|
||
{
|
||
url: "/og-image.jpg",
|
||
width: 1200,
|
||
height: 630,
|
||
alt: "Muğla Dijital Medya",
|
||
},
|
||
],
|
||
},
|
||
twitter: {
|
||
card: "summary_large_image",
|
||
title: "Muğla Dijital | Medya & Prodüksiyon Ajansı",
|
||
description: "Dijital dünyada markanızı zirveye taşıyın.",
|
||
images: ["/og-image.jpg"],
|
||
},
|
||
robots: {
|
||
index: true,
|
||
follow: true,
|
||
googleBot: {
|
||
index: true,
|
||
follow: true,
|
||
'max-video-preview': -1,
|
||
'max-image-preview': 'large',
|
||
'max-snippet': -1,
|
||
},
|
||
}
|
||
};
|
||
}
|
||
|
||
export default function RootLayout({
|
||
children,
|
||
}: Readonly<{
|
||
children: React.ReactNode;
|
||
}>) {
|
||
return (
|
||
<html lang="tr">
|
||
<body
|
||
className={`${martianMono.variable} antialiased`}
|
||
>
|
||
<ClientWrapper>
|
||
{children}
|
||
</ClientWrapper>
|
||
<script
|
||
type="application/ld+json"
|
||
dangerouslySetInnerHTML={{
|
||
__html: JSON.stringify({
|
||
"@context": "https://schema.org",
|
||
"@type": "Organization",
|
||
"name": "Muğla Dijital Medya Ajansı",
|
||
"url": "https://mugladijitalmedya.com",
|
||
"logo": "https://mugladijitalmedya.com/logo.png",
|
||
"sameAs": [
|
||
"https://www.instagram.com/mugladijitalmedya/",
|
||
// Add other social media links here
|
||
],
|
||
"contactPoint": {
|
||
"@type": "ContactPoint",
|
||
"telephone": "+90-XXX-XXX-XXXX", // Should be updated with real phone
|
||
"contactType": "customer service",
|
||
"areaServed": "TR",
|
||
"availableLanguage": ["Turkish", "English"]
|
||
}
|
||
})
|
||
}}
|
||
/>
|
||
<script
|
||
type="application/ld+json"
|
||
dangerouslySetInnerHTML={{
|
||
__html: JSON.stringify({
|
||
"@context": "https://schema.org",
|
||
"@type": "LocalBusiness",
|
||
"name": "Muğla Dijital Medya Ajansı",
|
||
"image": "https://mugladijitalmedya.com/og-image.jpg",
|
||
"@id": "https://mugladijitalmedya.com",
|
||
"url": "https://mugladijitalmedya.com",
|
||
"telephone": "+90-XXX-XXX-XXXX",
|
||
"address": {
|
||
"@type": "PostalAddress",
|
||
"streetAddress": "Muğla",
|
||
"addressLocality": "Muğla",
|
||
"addressRegion": "Muğla",
|
||
"postalCode": "48000",
|
||
"addressCountry": "TR"
|
||
},
|
||
"geo": {
|
||
"@type": "GeoCoordinates",
|
||
"latitude": 37.2153,
|
||
"longitude": 28.3636
|
||
},
|
||
"openingHoursSpecification": {
|
||
"@type": "OpeningHoursSpecification",
|
||
"dayOfWeek": [
|
||
"Monday",
|
||
"Tuesday",
|
||
"Wednesday",
|
||
"Thursday",
|
||
"Friday",
|
||
"Saturday"
|
||
],
|
||
"opens": "09:00",
|
||
"closes": "18:00"
|
||
}
|
||
})
|
||
}}
|
||
/>
|
||
</body>
|
||
</html>
|
||
);
|
||
} |