108 lines
3.8 KiB
TypeScript
108 lines
3.8 KiB
TypeScript
import type { Metadata } from 'next'
|
||
import { cookies } from 'next/headers'
|
||
import './globals.css'
|
||
import { LangProvider } from '@/context/LangContext'
|
||
import { siteConfig, hasIosStoreUrl } from '@/lib/site'
|
||
|
||
export const metadata: Metadata = {
|
||
metadataBase: new URL(siteConfig.domain),
|
||
title: {
|
||
default: 'GreenLens – Pflanzen erkennen & Pflege-App',
|
||
template: '%s',
|
||
},
|
||
description:
|
||
'GreenLens erkennt Pflanzen per Foto in Sekunden und liefert sofort Pflegeplan, Gießerinnerungen und Gesundheitscheck — alles in einer App.',
|
||
keywords: [
|
||
'Pflanzen erkennen App',
|
||
'Pflanzen bestimmen per Foto',
|
||
'Blumen Scanner',
|
||
'Pflanzen erkennen per Foto',
|
||
'plant identifier app',
|
||
'plant care app',
|
||
'Pflanzen App',
|
||
'GreenLens',
|
||
],
|
||
authors: [{ name: siteConfig.name }],
|
||
openGraph: {
|
||
title: 'GreenLens – Pflanzen erkennen & Pflege-App',
|
||
description: 'Pflanzen per Foto erkennen, Pflegeplan erhalten und Gesundheitsprobleme diagnostizieren — alles in einer App.',
|
||
type: 'website',
|
||
url: siteConfig.domain,
|
||
},
|
||
alternates: {
|
||
// Do not emit hreflang until each language has its own URL.
|
||
languages: {},
|
||
},
|
||
twitter: {
|
||
card: 'summary_large_image',
|
||
title: 'GreenLens – Pflanzen erkennen & Pflege-App',
|
||
description: 'Pflanzen per Foto erkennen, Pflegeplan erhalten und Gesundheitsprobleme diagnostizieren — alles in einer App.',
|
||
},
|
||
}
|
||
|
||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||
const cookieStore = await cookies()
|
||
const lang = (cookieStore.get('lang')?.value ?? 'de') as 'de' | 'en' | 'es'
|
||
const validLangs = ['de', 'en', 'es']
|
||
const htmlLang = validLangs.includes(lang) ? lang : 'de'
|
||
|
||
return (
|
||
<html lang={htmlLang}>
|
||
<head>
|
||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||
<script
|
||
type="application/ld+json"
|
||
dangerouslySetInnerHTML={{
|
||
__html: JSON.stringify([
|
||
{
|
||
'@context': 'https://schema.org',
|
||
'@type': 'WebSite',
|
||
name: siteConfig.name,
|
||
url: siteConfig.domain,
|
||
inLanguage: ['de', 'en', 'es'],
|
||
},
|
||
{
|
||
'@context': 'https://schema.org',
|
||
'@type': 'SoftwareApplication',
|
||
name: siteConfig.name,
|
||
operatingSystem: 'iOS, Android',
|
||
applicationCategory: 'LifestyleApplication',
|
||
description:
|
||
'Pflanzen per Foto erkennen, Pflegeplan erhalten und Gesundheitsprobleme diagnostizieren.',
|
||
inLanguage: ['de', 'en', 'es'],
|
||
...(hasIosStoreUrl && { downloadUrl: siteConfig.iosAppStoreUrl }),
|
||
offers: {
|
||
'@type': 'Offer',
|
||
price: '0',
|
||
priceCurrency: 'EUR',
|
||
},
|
||
},
|
||
{
|
||
'@context': 'https://schema.org',
|
||
'@type': 'Organization',
|
||
name: siteConfig.name,
|
||
url: siteConfig.domain,
|
||
description:
|
||
'GreenLens ist eine App zur Pflanzenerkennung und Pflegeplanung für iOS und Android.',
|
||
contactPoint: {
|
||
'@type': 'ContactPoint',
|
||
contactType: 'customer support',
|
||
email: siteConfig.supportEmail,
|
||
},
|
||
...(hasIosStoreUrl && {
|
||
sameAs: [siteConfig.iosAppStoreUrl],
|
||
}),
|
||
},
|
||
]),
|
||
}}
|
||
/>
|
||
</head>
|
||
<body>
|
||
<LangProvider>{children}</LangProvider>
|
||
</body>
|
||
</html>
|
||
)
|
||
}
|