Provisioning Content

Specifying initial content to import into your content source when duplicating a repository.

import

One method for creating new projects is to duplicate a GitHub repository. When duplicating a repository, Netlify Create will create a new repository for you, plus a new content space (in case of Contentful) or dataset (in Sanity).

Through the import configuration property, you can specify the initial payload of models and content to import when a repository is duplicated.

The import option is available when using a supported API-based content source.

Required
If the starter being duplicated is using an external CMS.
Allowed Values
An object with properties based on the content source.

Each content source has a unique set of properties. Here's an example which uses Contentful:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
export default {
  contentSources: [
    new ContentfulContentSource({
      spaceId: process.env.CONTENTFUL_SPACE_ID,
      environment: process.env.CONTENTFUL_ENVIRONMENT,
      previewToken: process.env.CONTENTFUL_PREVIEW_TOKEN,
      accessToken: process.env.CONTENTFUL_MANAGEMENT_TOKEN,
    }),
  ],
  models: {
    // page definitions and model decorations ...
  },
  import: {
    type: 'contentful',
    contentFile: 'contentful/export.json',
    uploadAssets: true,
    assetsDirectory: 'contentful',
    spaceIdEnvVar: 'CONTENTFUL_SPACE_ID',
    deliveryTokenEnvVar: 'CONTENTFUL_DELIVERY_TOKEN',
    previewTokenEnvVar: 'CONTENTFUL_PREVIEW_TOKEN',
  },
  // other properties ...
}

See the following integration guides for more information about working with that source:

Contact us if you have this need and your content source is not listed.