feat(cms): add storage based website content management
This commit is contained in:
parent
7d5689cfa4
commit
12d31f5468
31 changed files with 1347 additions and 158 deletions
29
app/seo.ts
29
app/seo.ts
|
|
@ -1,4 +1,5 @@
|
|||
import type { Metadata } from "next";
|
||||
import type { SeoContent } from "@/lib/content/types";
|
||||
|
||||
const siteName = "Funktechnik Schubert";
|
||||
const defaultTitle = "Funktechnik Schubert | Funkgeräte-Service & Messtechnik";
|
||||
|
|
@ -59,4 +60,32 @@ export function createMetadata(title: string, description: string, path = "/"):
|
|||
};
|
||||
}
|
||||
|
||||
export function createContentMetadata(seo: SeoContent): Metadata {
|
||||
const path = seo.canonicalUrl || "/";
|
||||
const url = new URL(path, siteUrl).toString();
|
||||
const title = seo.metaTitle || siteName;
|
||||
const description = seo.metaDescription || defaultTitle;
|
||||
|
||||
return {
|
||||
...createMetadata(title, description, path),
|
||||
keywords: seo.keywords ? seo.keywords.split(",").map((keyword) => keyword.trim()).filter(Boolean) : keywords,
|
||||
openGraph: {
|
||||
type: "website",
|
||||
locale: "de_DE",
|
||||
url,
|
||||
siteName,
|
||||
title: seo.openGraphTitle || title,
|
||||
description: seo.openGraphDescription || description,
|
||||
images: [
|
||||
{
|
||||
url: seo.socialImage || "/funktechnik_schubert_logo.jpg",
|
||||
width: 1200,
|
||||
height: 630,
|
||||
alt: seo.openGraphTitle || title,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export { defaultTitle, siteName, siteUrl };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue