Pages -> App (#265)

* pages -> app

* add meta test

* fix gosuslugi
This commit is contained in:
tmshv authored and GitHub committed 2026-02-09 00:25:06 +07:00
1 parent 0c8d74b21d
commit a1e51e78f0
23 files changed
+522 -516

No files matched your search

+22
View File
@@ -1,3 +1,4 @@
import type { Metadata } from "next"
import type { Meta, Pic } from "@/types"
export function meta(props: Partial<Meta>): Meta {
@@ -80,3 +81,24 @@ export class MetaBuilder {
}
}
}
export function buildMetadata(m: Meta): Metadata {
return {
title: m.title,
description: m.description,
openGraph: {
url: m.url,
title: m.title,
description: m.description,
siteName: m.siteName,
locale: m.locale,
type: m.type as "website",
images: [{ url: m.image, width: m.imageWidth, height: m.imageHeight }],
},
twitter: {
card: m.twitterCard as "summary_large_image",
site: m.twitterSite,
creator: m.twitterCreator,
},
}
}