Initial commit
This commit is contained in:
commit
5a3bf52ebb
86 changed files with 2639 additions and 0 deletions
17
studio/schemas/documents/category.js
Normal file
17
studio/schemas/documents/category.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export default {
|
||||
name: 'category',
|
||||
type: 'document',
|
||||
title: 'Category',
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
title: 'Title'
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
type: 'text',
|
||||
title: 'Description'
|
||||
}
|
||||
]
|
||||
}
|
||||
41
studio/schemas/documents/person.js
Normal file
41
studio/schemas/documents/person.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import MdPerson from 'react-icons/lib/md/person'
|
||||
|
||||
export default {
|
||||
name: 'person',
|
||||
type: 'document',
|
||||
title: 'Person',
|
||||
icon: MdPerson,
|
||||
fields: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'string',
|
||||
title: 'Name'
|
||||
},
|
||||
{
|
||||
name: 'slug',
|
||||
type: 'slug',
|
||||
title: 'Slug',
|
||||
description: 'Some frontend will require a slug to be set to be able to show the person',
|
||||
options: {
|
||||
source: 'name',
|
||||
maxLength: 96
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
title: 'Image',
|
||||
type: 'figure'
|
||||
},
|
||||
{
|
||||
name: 'bio',
|
||||
title: 'Bio',
|
||||
type: 'bioPortableText'
|
||||
}
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: 'name',
|
||||
media: 'image'
|
||||
}
|
||||
}
|
||||
}
|
||||
90
studio/schemas/documents/project.js
Normal file
90
studio/schemas/documents/project.js
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
import {format} from 'date-fns'
|
||||
|
||||
export default {
|
||||
name: 'project',
|
||||
title: 'Project',
|
||||
type: 'document',
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
name: 'slug',
|
||||
title: 'Slug',
|
||||
type: 'slug',
|
||||
description: 'Some frontend will require a slug to be set to be able to show the project',
|
||||
options: {
|
||||
source: 'title',
|
||||
maxLength: 96
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'publishedAt',
|
||||
title: 'Published at',
|
||||
description: 'You can use this field to schedule projects where you show them',
|
||||
type: 'datetime'
|
||||
},
|
||||
{
|
||||
name: 'excerpt',
|
||||
title: 'Excerpt',
|
||||
type: 'simplePortableText'
|
||||
},
|
||||
{
|
||||
name: 'members',
|
||||
title: 'Members',
|
||||
type: 'array',
|
||||
of: [{type: 'projectMember'}]
|
||||
},
|
||||
{
|
||||
name: 'startedAt',
|
||||
title: 'Started at',
|
||||
type: 'datetime'
|
||||
},
|
||||
{
|
||||
name: 'endedAt',
|
||||
title: 'Ended at',
|
||||
type: 'datetime'
|
||||
},
|
||||
{
|
||||
name: 'mainImage',
|
||||
title: 'Main image',
|
||||
type: 'figure'
|
||||
},
|
||||
{
|
||||
name: 'categories',
|
||||
title: 'Categories',
|
||||
type: 'array',
|
||||
of: [{type: 'reference', to: {type: 'category'}}]
|
||||
},
|
||||
{
|
||||
name: 'body',
|
||||
title: 'Body',
|
||||
type: 'projectPortableText'
|
||||
},
|
||||
{
|
||||
name: 'relatedProjects',
|
||||
title: 'Related projects',
|
||||
type: 'array',
|
||||
of: [{type: 'reference', to: {type: 'project'}}]
|
||||
}
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: 'title',
|
||||
publishedAt: 'publishedAt',
|
||||
slug: 'slug',
|
||||
media: 'mainImage'
|
||||
},
|
||||
prepare ({title = 'No title', publishedAt, slug, media}) {
|
||||
const dateSegment = format(publishedAt, 'YYYY/MM')
|
||||
const path = `/${dateSegment}/${slug.current}/`
|
||||
return {
|
||||
title,
|
||||
media,
|
||||
subtitle: publishedAt ? path : 'Missing publishing date'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
studio/schemas/documents/siteSettings.js
Normal file
35
studio/schemas/documents/siteSettings.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
export default {
|
||||
name: 'siteSettings',
|
||||
type: 'document',
|
||||
title: 'Site Settings',
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
title: 'Title'
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
type: 'text',
|
||||
title: 'Description',
|
||||
description: 'Describe your portfolio for search engines and social media.'
|
||||
},
|
||||
{
|
||||
name: 'keywords',
|
||||
type: 'array',
|
||||
title: 'Keywords',
|
||||
description: 'Add keywords that describes your portfolio.',
|
||||
of: [{type: 'string'}],
|
||||
options: {
|
||||
layout: 'tags'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'author',
|
||||
type: 'reference',
|
||||
description: 'Publish an author and set a reference to them here.',
|
||||
title: 'Author',
|
||||
to: [{type: 'person'}]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue