Skip to main content

Storyblok CMS

This package provides a Storyblok CMS integration for Gesso CMS.

Installation

  • pnpm install

Configuration

  • Create a .env file in the root of the project based on .env.example

Usage

  • pnpm test to run the tests
  • pnpm lint to lint the code

Storyblok Component Exports (exports/)

This repository contains export data for Gesso Storyblok builds. It's purpose is to provide a starting point for Storyblok projects by adding a set of components and content types to the Storyblok space that connect to Gesso's Component Factory. Similiar to 'Paragraphs' in Drupal.

Exports are found in the exports directory. They are JSON files that can be imported into a Storyblok space.

Updating the Exports

Using the Storyblok CLI, you can export the current state of the space to a JSON file. We will pull the components from the Gesso Storyblok space.

  • pnpm i -g storyblok: Install the Storyblok CLI
  • pnpx storyblok login: Authenticate with storyblok
  • pnpx storyblok pull-components -s 1020994 --sf -p exports/ -f gesso --rd: Pull the components from the Storyblok space
    • -s 1020994: The Storyblok space ID for Gesso
    • --sf: Seperate files for each component
    • -p exports/: The directory to save the components
    • -f gesso: The prefix for the component files
    • --rd: (Resolve Datasources) Fill options for single/multiple option field with the linked datasource

Importing the Exports

To import the exports into a Storyblok space, you can use the Storyblok CLI. Note: This doesn't handle clashes with existings components, if you have groups / components with the same name, you will need to handle this manually.

  • pnpm i -g storyblok: Install the Storyblok CLI
  • pnpx storyblok login: Authenticate with Storyblok
  • pnpx storyblok spaces: Get the space ID for the Storyblok space you want to import into
  • pnpx storyblok push-components -s <space_id> the_exports_file.json: Push the components to the Storyblok space

Push all components

  • pnpx storyblok push-datasources -s <space_id> exports/all/components.gesso.json: Push the datasources to the Storyblok space

Push individual components

  • pnpx storyblok push-datasources -s <space_id> exports/the_component_to_push.json: Push the datasources to the Storyblok space