Yoast SEO Analysis.
> yarn add @kaliber/sanity-plugin-seo
sanity.config.js
import { sanityPluginSeo, SeoAnalysis, typeHasSeo } from '@kaliber/sanity-plugin-seo'
defineConfig({
...
plugins: [
deskTool({
defaultDocumentNode: (S, context) => {
const getClient = context.getClient.bind(context)
const views = [
S.view.form(),
typeHasSeo(context) && S.view
.component(SeoAnalysis)
.options({ multiLanguage, resolvePublishedUrl, resolvePreviewUrl, getClient, reportError })
.title('SEO'),
].filter(Boolean)
return S.document().views(views)
},
...
}),
sanityPluginSeo(),
...
]
})
schema/documents/pagina.js
export const pagina = {
type: 'document',
name: 'pagina',
title: 'Pagina',
fields: [
{
title: 'SEO',
name: 'seo',
type: 'seo'
},
...
],
}
> yarn
> yarn link
project/> yarn link @kaliber/sanity-plugin-seo
yarn publish
git push
git push --tags