All Projects → storyblok → Storyblok

storyblok / Storyblok

You found an issue with one of our products? - submit it here as an issue!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Storyblok

Docker
Directus Docker — The Official Docker Container for the Directus Suite
Stars: ✭ 93 (-54.85%)
Mutual labels:  cms, headless-cms, headless
Builder
Drag and drop page building using your code components
Stars: ✭ 1,281 (+521.84%)
Mutual labels:  cms, headless-cms, headless
Unite Cms
Really flexible headless CMS, built on top of Symfony and GraphQL.
Stars: ✭ 242 (+17.48%)
Mutual labels:  cms, headless-cms, headless
Mix.core
🚀 Mixcore CMS is an open source CMS that support both headless and decoupled to easily build any kinds of app/web app/customisable APIs built on top of ASP.NET Core / Dotnet Core. It is a completely open source ASP.NET Core (Dotnet Core) CMS solution. https://mixcore.org
Stars: ✭ 304 (+47.57%)
Mutual labels:  cms, headless-cms, headless
App
Directus Admin Application — An Intuitive WebApp for Managing Database Content
Stars: ✭ 464 (+125.24%)
Mutual labels:  cms, headless-cms, headless
Contentjet Ui
Headless API-first content management system
Stars: ✭ 42 (-79.61%)
Mutual labels:  cms, headless-cms, headless
Awesome Headless Cms
An awesome list of headless / decoupled CMS resources.
Stars: ✭ 118 (-42.72%)
Mutual labels:  cms, headless-cms, headless
Ghost Cli
CLI Tool for installing & updating Ghost
Stars: ✭ 313 (+51.94%)
Mutual labels:  cli, cms, headless-cms
Flextype
Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS
Stars: ✭ 436 (+111.65%)
Mutual labels:  cms, headless-cms, headless
Cockpit
Add content management functionality to any site - plug & play / headless / api-first CMS
Stars: ✭ 5,173 (+2411.17%)
Mutual labels:  cms, headless-cms, headless
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+6302.91%)
Mutual labels:  cms, headless-cms, headless
Squidex
Headless CMS and Content Managment Hub
Stars: ✭ 1,583 (+668.45%)
Mutual labels:  cms, headless-cms
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+20184.47%)
Mutual labels:  cms, headless-cms
Ghost
Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Stars: ✭ 39,261 (+18958.74%)
Mutual labels:  cms, headless-cms
Elepy
Elepy, The Headless Content Management Framework
Stars: ✭ 109 (-47.09%)
Mutual labels:  cms, headless-cms
Cli
Get a programmable email address. Automate what happens when you receive emails. It's like Zapier for devs who hate emails.
Stars: ✭ 105 (-49.03%)
Mutual labels:  cli, headless
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-46.12%)
Mutual labels:  cms, headless
Sdk Js
Directus JS SDK — JavaScript Software Development Kit for Node and Browser
Stars: ✭ 117 (-43.2%)
Mutual labels:  headless-cms, headless
Headlesschrome
A Go package for working with headless Chrome. Run interactive JavaScript commands on web pages with Go and Chrome.
Stars: ✭ 112 (-45.63%)
Mutual labels:  cli, headless
Shio
✨ :dna: Shio CMS - Model Content, Use GraphQL and Create Site using Javascript with Native Cache and Search.
Stars: ✭ 119 (-42.23%)
Mutual labels:  cms, headless-cms

Storyblok CLI

A simple CLI for scaffolding Storyblok projects and fieldtypes.

You found an issue?
Tell us about it - open an issue or look if it was already reported.

npm npm GitHub issues GitHub closed issues

Installation

Make sure you've node >= 9.11.0 installed.

$ npm i storyblok -g

Commands

select

Usage to kickstart a boilerplate, fieldtype or theme

$ storyblok select

pull-components

Download your space's components schema as json

$ storyblok pull-components --space <SPACE_ID>

Options

  • space: your space id

push-components

Push your components file to your/another space

$ storyblok push-components <SOURCE> --space <SPACE_ID>

Parameters

  • source: can be a URL or path to JSON file.

Using an URL

$ storyblok push-components https://raw.githubusercontent.com/storyblok/nuxtdoc/master/seed.components.json --space 67819

Using a path to file

$ storyblok push-components ./components.json --space 67819

Options

  • space: your space id

sync

Sync components, folder, roles or stories between spaces

$ storyblok sync --type <COMMAND> --source <SPACE_ID> --target <SPACE_ID>

Options

  • type: describe the command type to execute. Can be: folders, components, stories or roles. It's possible pass multiple types separated by comma (,).
  • source: the source space to use to sync
  • target: the target space to use to sync

Examples

# Sync components from `00001` space to `00002` space
$ storyblok sync --type components --source 00001 --target 00002

# Sync components and stories from `00001` space to `00002` space
$ storyblok sync --type components,stories --source 00001 --target 00002

quickstart

Create a space in Storyblok and select the boilerplate to use

$ storyblok quickstart

logout

Logout from the Storyblok cli

$ storyblok logout

login

Login to the Storyblok cli

$ storyblok login

generate-migration

Create a migration file (with the name change_<COMPONENT>_<FIELD>.js) inside the migrations folder. Check Migrations section to more details

$ storyblok generate-migration --space <SPACE_ID> --component <COMPONENT_NAME> --field <FIELD>

Options

  • space: space where the component is
  • component: component name. It needs to be a valid component
  • field: name of field

run-migration

Execute a specific migration file. Check Migrations section to more details

$ storyblok run-migration --space <SPACE_ID> --component <COMPONENT_NAME> --field <FIELD> --dryrun

Optionally you can provide the publish parameter to publish content after saving. Example:

$ storyblok run-migration --publish published --space 1234 --component article --field image

Options

  • space: the space you get from the space settings area
  • component: component name. It needs to be a valid component
  • field: name of field
  • dryrun: when passed as an argument, does not perform the migration
  • publish (optional): publish the content when update
    • all: publish all stories, even if they have not yet been published
    • published: only publish stories that already are published and don't have unpublished changes
    • published-with-changes: publish stories that are published and have unpublished changes
  • publish-languages (optional): publish specific languages. You can publish more than one language at a time by separating the languages by ,

rollback-migration

The rollback-migration command gives the possibility to undo the changes made from the execution of the last run-migrations command.

$ storyblok rollback-migration --space 1234 --component Product --field title

Important: The rollback-migrations command will only work if there where changes done with run-migrations. Therefore running run-migrations command with the --dryrun flag will NOT create a rollback file.

options

  • space: the space you get from the space settings area
  • component: component name. It needs to be a valid component
  • field: name of field

spaces

List all spaces of the logged account

$ storyblok spaces

import

This command gives you the possibility to import flat content from .csv, .xml and .json files coming from other systems.

The attributes path and title are required.

$ storyblok import --file <FILE_NAME> --type <TYPE_OF_CONTENT> --folder <FOLDER_ID> --delimiter <DELIMITER_TO_CSV_FILES> --space <SPACE_ID>

A xml file needs to have following format:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <row>
    <path>this-is-my-title</path>
    <title>This is my title</title>
    <text>Lorem ipsum dolor sit amet</text>
    <image>https://a.storyblok.com/f/51376/x/1502f01431/corporate-website.svg</image>
    <category>press</category>
  </row>
</root>

A csv file needs to have following format. The first row is used to identify the attribute names:

path;title;text;image;category
this-is-my-title;This is my title;"Lorem ipsum dolor sit amet";https://a.storyblok.com/f/51376/x/1502f01431/corporate-website.svg;press

A json file need to have following format:

[ 
  {
    "path": "this-is-my-title",
    "title": "This is my title",
    "text": "Lorem ipsum dolor sit amet",
    "image": "https://a.storyblok.com/f/51376/x/1502f01431/corporate-website.svg",
    "category": "press"
  }
]

Options

  • file: name of the file
  • type: name of the content type you want to use for the import
  • space: id of your space
  • delimiter (optional): delimiter of the .cvs files, only necessary if you are uploading a csv file (Default value is ; )
  • folder (optional): id of the folder where you want to store the content in Storyblok

Help

For global help

$ storyblok --help

For command help

$ storyblok sync --help

Version

For view the CLI version

$ storyblok -V # or --version

Content migrations

Content migrations are a convenient way to change fields of your content.

To execute a migration you first need to create a migration file. This file is a pure Javascript function where the content of a specific content type or compontent gets passed through.

1. Creating a migration file

To create a migration file, you need to execute the generate-migration command:

# creating a migration file to product component to update the price
$ storyblok generate-migration --space 00000 --component product --field price

When you run this command a file called change_product_price.js will be created inside a folder called migrations.

The created file will have the following content:

// here, 'subtitle' is the name of the field defined when you execute the generate command
module.exports = function (block) {
  // Example to change a string to boolean
  // block.subtitle = !!(block.subtitle)

  // Example to transfer content from other field
  // block.subtitle = block.other_field
}

In the migration function you can manipulate the block variable to add or modify existing fields of the component.

2. Running the migration file

To run the migration function you need to execute the run-migration command. Pass the --dryrun option to not execute the updates and only show the changes in the terminal:

$ storyblok run-migration --space 00000 --component product --field price --dryrun

After checking the output of the dryrun you can execute the updates:

# you can use the --dryrun option to not execute the updates
$ storyblok run-migration --space 00000 --component product --field price

3. Publishing the content

You can execute the migration and, when update the content, publish it using the --publish and --publish-languages options. When you use the publish option, you need to specific one of these following options: 'all', 'published' or 'published-with-changes':

$ storyblok run-migration --space 00000 --component product --field price --publish all

You can specify the languages to update using --publish-languages=<LANGUAGE> or update all languages using --publish-languages=ALL_LANGUAGES:

# to update only one language
$ storyblok run-migration --space 00000 --component product --field price --publish all --publish-languages=de

# to update more than one language
$ storyblok run-migration --space 00000 --component product --field price --publish all --publish-languages=de,pt

4. Rollback migrations

Whenever you run a run-migrations command a json file containing all the content before the change takes place will be generated. Important, this just doesn't apply if you add the --dryrun flag.

Remembering that, the content that will be saved is always related to the last run-migrations command, that is, if you run the run-migrations command twice changing the same component, the content will only be saved before the last update.

Examples

1. Change an image field

Let's create an example to update all occurrences of the image field in product component. In the example we replace the url from //a.storyblok.com to //my-custom-domain.com.

First, you need to create the migration function:

$ storyblok generate-migration --space 00000 --component product --field image

Then let's update the default image field:

module.exports = function (block) {
  block.image = block.image.replace('a.storyblok.com', 'my-custom-domain.com')
}

Now you can execute the migration file:

$ storyblok run-migration --space 00000 --component product --field image --dryrun

2. Transform a Markdown field into a Richtext field

To transform a markdown or html field into a richtext field you first need to install a converter library.

$ npm install storyblok-markdown-richtext -g

Now check the path to the global node modules folder

$ npm root -g

Generate the migration with storyblok generate-migration --space 00000 --component blog --field intro and apply the transformation:

var richtextConverter = require('/usr/local/lib/node_modules/storyblok-markdown-richtext')

module.exports = function (block) {
  if (typeof block.intro == 'string') {
    block.intro = richtextConverter.markdownToRichtext(block.intro)
  }
}

You're looking for a headstart?

Check out our guides for client side apps (VueJS, Angular, React, ...), static site (Jekyll, NuxtJs, ...), dynamic site examples (Node, PHP, Python, Laravel, ...) on our Getting Started page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].