如何将报价块添加到 Sanity? (NextJS)

问题描述 投票:0回答:1

我正在开发一个 NextJS 项目。该项目的博客页面使用 Sanity 进行内容管理。我希望能够创建这样的块引号:enter image description here

我查看了他们的文档以及 Sanity 工作室,但没有找到我需要的东西,感谢任何帮助。

next.js sanity
1个回答
0
投票

您想创建一个包含图像和富文本的架构吗?

  defineField({
          name: 'carousel',
          title: 'Carousel',
          type: 'array',
          of: [{type: 'carousel'}],
        }),

然后

export default {
  name: 'carousel',
  title: 'Carousel*',
  type: 'document',
  validation: (Rule) => Rule.required(),
  fields: [
    defineField({
      name: 'icon',
      title: 'icon',
      type: 'image',
    }),
    defineField({
      name: 'text',
      title: 'text',
      type: 'array',
      of: [{type: 'block'}],
    }),
  }

如果我明白你想要什么,这样的事情就会起作用。

© www.soinside.com 2019 - 2024. All rights reserved.