/xp-storybook

Storybook integration with XP

Primary LanguageJavaMIT LicenseMIT

Storybook Server integration for Enonic XP

This application integrates with Storybook Server renderer and can render Freemarker templates or Thymeleaf templates with the args from Storybook.

Caution

This application should never be deployed in production! An attacker can use this application to render any content on your domain.

Configuration

You need to create a configuration file: XP_HOME/config/no.item.storybook.cfg with the following content:

iAmNotFoolishEnoughToDeployThisInProduction=true
xpResourcesDirPath=/home/ubuntu/code/my-xp-project/src/main/resources
renderMode=freemarker
Config key Value
iAmNotFoolishEnoughToDeployThisInProduction You will set this to true to indicate that you understand that this must never be deployed on a server open to the internet.
xpResourcesDirPath The resources directory in your XP-project. This can also be a comma separated string with multiple resource directories (Freemarker only).
renderMode (optional) If the template language can not be determined by the file extension or renderMode query parameter, this fallback value will be used. Legal options are: freemarker or thymeleaf

Getting started

You will find information on how to set up your project in the xp-storybook-utils documentation.

Deploying

Building

To build he project run the following code

enonic project build

Deploy locally

Deploy locally for testing purposes:

enonic project deploy

Deploy to Jitpack

Go to the Jitpack page for xp-storybook to deploy from Github (after creating a new versioned release).