Sha256: 79e22dea9327d87ac834622aba304d8b0a1abbfe99c1b676744dcfffe00ef3c9
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
import Migration from 'contentful-migration-cli' export = function (migration: Migration) { const page = migration.createContentType('page') .name('Page') .description('A page describes a collection of sections that correspond' + 'to a URL slug') .displayField('title') page.createField('title') .name('Title') .type('Symbol') .required(true) page.createField('slug') .name('Slug') .type('Symbol') .required(true) .validations([ { unique: true }, { regexp: { pattern: "(\\/|\\/([\w#!:.?+=&%@!\\-\\/]))?$" }, message: "The slug must look like the path part of a URL and begin with a forward slash, example: '/my-page-slug'" } ]) page.createField('sections') .name('Sections') .type('Array') .items({ type: 'Link', linkType: 'Entry' }) page.createField('subpages') .name('Subpages') .type('Array') .items({ type: 'Link', linkType: 'Entry', validations: [ { linkContentType: [ 'page' ] } ] }) }
Version data entries
8 entries across 8 versions & 2 rubygems