feat: useNodeSeo
This commit is contained in:
14
wp-content/themes/headless/app/composables/useNodeSeo.ts
Normal file
14
wp-content/themes/headless/app/composables/useNodeSeo.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user