15 lines
395 B
TypeScript
15 lines
395 B
TypeScript
import type { NodeSeoFragment } from "#graphql/types";
|
|
|
|
export function useNodeSeo(seo: NodeSeoFragment) {
|
|
const { title, description, robots, canonicalUrl, openGraph } = seo;
|
|
useSeoMeta({
|
|
title,
|
|
description,
|
|
robots: robots?.join(","),
|
|
ogTitle: openGraph?.title,
|
|
ogDescription: openGraph?.description,
|
|
ogImage: openGraph?.image?.url,
|
|
ogUrl: canonicalUrl,
|
|
});
|
|
}
|