Ruby/Sinatra Example of a Storyblok Integration
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
public/assets
views
.editorconfig
.gitignore
Gemfile
Gemfile.lock
README.md
app.rb
config.ru

README.md

sinatra-boilerplate for Storyblok

A Storyblok boilerplate in ruby with sinatra to simply start your website with us.


GitHub release

What is a storyblok boilerplate

If you want to use your server or have already an existing project in which you want to integrate Storyblok you can use one of our boilerplates.

How can I start with a boilerplate

  1. download or clone this repository
git clone https://github.com/storyblok/sinatra-boilerplate
  1. Install the dependencies
bundle install
  1. Run the local server and open your browser with the address localhost:4567
rerun --pattern '{Gemfile,Gemfile.lock,app.rb,app/**/*.rb}' 'ruby app.rb'
  1. Signup at Storyblok, create a Space and a Story with the slug "demo". In your space settings you can get the api token. Exchange it in Storyblok::Client.new in app.rb.

Configuration

In the app.rb all you need to change is the storyblok client settings - by adding your space information. What is a Space?:

token: 'Iw3XKcJb6MwkdZEwoQ9BCQtt'

Start your local environment

Make sure Ruby and Bundler are installed:

bundle install
rerun --pattern '{Gemfile,Gemfile.lock,app.rb,app/**/*.rb}' 'ruby app.rb'

Folder structure

  • /app/ The ruby application using sinatra itself.
  • /views/ All your layouts and components at one space - if you add a new or change an existing Liquid component (.liquid) here is the place where you would put it. If you create a headline component in storyblok - make sure to create a headline.liquid as well - so the application knows which component to render.
  • /public/ The place where your styles, scripts, images and static files are put.

You want to know more about storyblok?



Storyblok Logo