Socket
Socket
Sign inDemoInstall

sanity-plugin-stackup-seo

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sanity-plugin-stackup-seo

> This is a **Sanity Studio v3** plugin.


Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

sanity-plugin-stackup-seo

This is a Sanity Studio v3 plugin.

Installation

# npm
npm install sanity-plugin-stackup-seo

# yarn
yarn add sanity-plugin-stackup-seo

# pnpm
pnpm i sanity-plugin-stackup-seo

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import {seo} from "sanity-plugin-stackup-seo";

export default defineConfig({
  //...
  plugins: [seo()],
})

Now, in your document schema, add the suSeo type as a field. For example:

export default {
  name: 'page',
  title: 'Page',
  type: 'document',
  fields: [
    // ...myAmazingFields,
    {
      name: 'seo',
      title: 'SEO & Social',
      type: 'suSeo',
    },
  ]
}

This can now be queried on your front-end. The SEO object should be returned in the following format:

    {
      seoImage: [Object],
      seoDescription: String,
      _type: 'suSeo',
      seoKeywords: String[],
      seoTitle: String
    }

Gotchas

There is a recognised issue around running the Studio with v5.x of styled-components. If are getting errors in the studio, please ensure your Sanity packages are up to date and that styled-components is on a version > 6.0.0.

After upgrading, delete your chosen package manager's .lock file and node_modules then reinstall your packages.

License

MIT © Jamie Bradley (StackUp Digital)

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Keywords

FAQs

Last updated on 17 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc