|
| 1 | +/** |
| 2 | + * This is the schema definition for the rich text fields used for |
| 3 | + * for this blog studio. When you import it in schemas.js it can be |
| 4 | + * reused in other parts of the studio with: |
| 5 | + * { |
| 6 | + * name: 'someName', |
| 7 | + * title: 'Some title', |
| 8 | + * type: 'blockContent' |
| 9 | + * } |
| 10 | + */ |
| 11 | +export default { |
| 12 | + title: 'Block Content', |
| 13 | + name: 'blockContent', |
| 14 | + type: 'array', |
| 15 | + of: [ |
| 16 | + { |
| 17 | + title: 'Block', |
| 18 | + type: 'block', |
| 19 | + // Styles let you set what your user can mark up blocks with. These |
| 20 | + // correspond with HTML tags, but you can set any title or value |
| 21 | + // you want and decide how you want to deal with it where you want to |
| 22 | + // use your content. |
| 23 | + styles: [ |
| 24 | + {title: 'Normal', value: 'normal'}, |
| 25 | + {title: 'H1', value: 'h1'}, |
| 26 | + {title: 'H2', value: 'h2'}, |
| 27 | + {title: 'H3', value: 'h3'}, |
| 28 | + {title: 'H4', value: 'h4'}, |
| 29 | + {title: 'Quote', value: 'blockquote'}, |
| 30 | + ], |
| 31 | + lists: [{title: 'Bullet', value: 'bullet'}], |
| 32 | + // Marks let you mark up inline text in the block editor. |
| 33 | + marks: { |
| 34 | + // Decorators usually describe a single property – e.g. a typographic |
| 35 | + // preference or highlighting by editors. |
| 36 | + decorators: [ |
| 37 | + {title: 'Strong', value: 'strong'}, |
| 38 | + {title: 'Emphasis', value: 'em'}, |
| 39 | + ], |
| 40 | + // Annotations can be any object structure – e.g. a link or a footnote. |
| 41 | + annotations: [ |
| 42 | + { |
| 43 | + title: 'URL', |
| 44 | + name: 'link', |
| 45 | + type: 'object', |
| 46 | + fields: [ |
| 47 | + { |
| 48 | + title: 'URL', |
| 49 | + name: 'href', |
| 50 | + type: 'url', |
| 51 | + }, |
| 52 | + ], |
| 53 | + }, |
| 54 | + ], |
| 55 | + }, |
| 56 | + }, |
| 57 | + // You can add additional types here. Note that you can't use |
| 58 | + // primitive types such as 'string' and 'number' in the same array |
| 59 | + // as a block type. |
| 60 | + { |
| 61 | + type: 'image', |
| 62 | + options: {hotspot: true}, |
| 63 | + }, |
| 64 | + ], |
| 65 | +} |
0 commit comments