Initial commit

This commit is contained in:
Waylon Walker 2019-05-09 10:15:41 -05:00
commit 5a3bf52ebb
86 changed files with 2639 additions and 0 deletions

View file

@ -0,0 +1,34 @@
export default {
name: 'bioPortableText',
type: 'array',
title: 'Excerpt',
of: [
{
title: 'Block',
type: 'block',
styles: [{title: 'Normal', value: 'normal'}],
lists: [],
marks: {
decorators: [
{title: 'Strong', value: 'strong'},
{title: 'Emphasis', value: 'em'},
{title: 'Code', value: 'code'}
],
annotations: [
{
name: 'link',
type: 'object',
title: 'URL',
fields: [
{
title: 'URL',
name: 'href',
type: 'url'
}
]
}
]
}
}
]
}

View file

@ -0,0 +1,34 @@
export default {
name: 'figure',
title: 'Image',
type: 'image',
options: {
hotspot: true
},
fields: [
{
title: 'Caption',
name: 'caption',
type: 'string',
options: {
isHighlighted: true
}
},
{
name: 'alt',
type: 'string',
title: 'Alternative text',
validation: Rule => Rule.error('You have to fill out the alternative text.').required(),
description: 'Important for SEO and accessiblity.',
options: {
isHighlighted: true
}
}
],
preview: {
select: {
imageUrl: 'asset.url',
title: 'caption'
}
}
}

View file

@ -0,0 +1,42 @@
export default {
type: 'object',
name: 'projectMember',
title: 'Project Member',
fields: [
{
title: 'Person',
name: 'person',
type: 'reference',
to: {type: 'person'}
},
{
title: 'Roles',
name: 'roles',
type: 'array',
of: [{type: 'string'}],
options: {
layout: 'radio',
list: [
{title: 'Designer', value: 'designer'},
{title: 'Developer', value: 'developer'},
{title: 'Editor', value: 'editor'},
{title: 'Manager', value: 'manager'}
]
}
}
],
preview: {
select: {
personName: 'person.name',
roles: 'roles',
media: 'person.image'
},
prepare (data) {
return {
...data,
title: data.personName,
subtitle: data.roles && data.roles.join('/')
}
}
}
}

View file

@ -0,0 +1,51 @@
export default {
title: 'Portable Text',
name: 'projectPortableText',
type: 'array',
of: [
{
title: 'Block',
type: 'block',
// Styles let you set what your user can mark up blocks with. These
// corrensponds with HTML tags, but you can set any title or value
// you want and decide how you want to deal with it where you want to
// use your content.
styles: [
{title: 'Normal', value: 'normal'},
{title: 'H1', value: 'h1'},
{title: 'H2', value: 'h2'},
{title: 'H3', value: 'h3'},
{title: 'H4', value: 'h4'},
{title: 'Quote', value: 'blockquote'}
],
lists: [{title: 'Bullet', value: 'bullet'}],
// Marks let you mark up inline text in the block editor.
marks: {
// Decorators usually describe a single property e.g. a typographic
// preference or highlighting by editors.
decorators: [{title: 'Strong', value: 'strong'}, {title: 'Emphasis', value: 'em'}],
// Annotations can be any object structure e.g. a link or a footnote.
annotations: [
{
title: 'URL',
name: 'link',
type: 'object',
fields: [
{
title: 'URL',
name: 'href',
type: 'url'
}
]
}
]
}
},
// You can add additional types here. Note that you can't use
// primitive types such as 'string' and 'number' in the same array
// as a block type.
{
type: 'figure'
}
]
}

View file

@ -0,0 +1,39 @@
/**
* This is the schema definition for the rich text fields used for
* for this blog studio. When you import it in schemas.js it can be
* reused in other parts of the studio with:
* {
* name: 'someName',
* title: 'Some title',
* type: 'simplePortableText'
* }
*/
export default {
title: 'Portable Text',
name: 'simplePortableText',
type: 'array',
of: [
{
title: 'Block',
type: 'block',
// Styles let you set what your user can mark up blocks with. These
// corrensponds with HTML tags, but you can set any title or value
// you want and decide how you want to deal with it where you want to
// use your content.
styles: [{title: 'Normal', value: 'normal'}],
lists: [],
// Marks let you mark up inline text in the block editor.
marks: {
// Decorators usually describe a single property e.g. a typographic
// preference or highlighting by editors.
decorators: [
{title: 'Strong', value: 'strong'},
{title: 'Emphasis', value: 'em'},
{title: 'Code', value: 'code'}
],
// Annotations can be any object structure e.g. a link or a footnote.
annotations: []
}
}
]
}