SpontaneousCMS / spontaneous

Spontaneous is a next-generation Ruby CMS
http://spontaneous.io
MIT License
78 stars 14 forks source link

Spontaneous CMS

Spontaneous is a revolutionary new content management system that brings the best of Ruby and the best of HTML5 together in one elegant package.

http://spontaneous.io

Spontaneous uses a powerful hierarchical system to organise your information. This breaks out of the bonds of the traditional "title, slug, text" model of CMS content and instead allows content authors to build complex, highly styled pages out of simple, easily editable blocks.

Status

Code Climate

Spontaneous is very much a work-in-progress but is currently almost feature complete. It has been used with great success on multiple sites. However the gem release is still marked as 'alpha' because the APIs are in constant flux.

Features currently supported

Aims

The ultimate aim of Spontaneous is to be a CMS system capable of adapting to and even leading the progress of the internet.

Publishing HTML pages is not enough, which is why the concept of multiple outputs has been baked into the system right from the start.

Eventually owners of a Spontaneous site will not only be able to publish their ideas to HTML pages but also use the same content to generate a EPUB & MOBI e-books, print quality PDFs to send to a printer and proprietry XML or JSON data for consumption by magazine applications running on tablets.

Roadmap

v1

Future

Example

A Spontaneous site is composed of pages. Within those pages are zero or more 'Boxes'. Each of those Boxes can be configured to accept the addition of zero or more types of object. These object types can either be Pages -- creating a page hierarchy -- or Pieces that are displayed as the page's content.

A Spontaneous site is composed of a set of 'Pages', 'Boxes' and 'Pieces'. Each 'page' in the system maps to a webpage, accessible through a URL. Within that page are a set of Boxes, Pieces and sub-Pages that combine together to form its content.

To use a concrete example, imagine a page in a site dedicated to publishing recipes.

If you think about how you'd go about describing a recipe you might come up with a list resembling the following:

In a traditional CMS system most of the above would have to be constructed using a rich-text editor. Using Spontaneous however you are able to map all of the elements above into discrete editable blocks.

The recipe page would have the following fields:

Along with these fields it would also have the following boxes:

In order to create a new recipe page the site editor simply needs to work through the recipe adding the ingredients and steps needed and filling in their details. At no point do they need to worry about the layout of the final page as this will be completely handled by the CMS when the page is displayed.

The configuration of Spontaneous's 'schema' (the list of Page, Piece and Box types needed to describe the site contents) is done using simple Ruby classes. For instance, in order to describe the content types described above you would need the following Ruby code:

class RecipePage < Page
  field :title
  field :introduction, :richtext
  field :image

  box :ingredients do
    allow :Ingredient
  end

  box :steps do
    allow :Step
  end
end

class Ingredient < Piece
  field :name,   :string
  field :amount, :string
end

class Step < Piece
  field :method, :richtext
  field :image
end

This will generate the following interface for the site editors:

Spontaneous interface

GETTING STARTED

Install RVM

    curl -L get.rvm.io | bash -s stable
    source ~/.rvm/scripts/'rvm'
    rvm requirements

Install Ruby

Spontaneous needs ruby >= 1.9.3 and Ruby >= 2.0 is preferred

    rvm install 2.1.2

Install Spontaneous

    gem install spontaneous --pre

Now generate your site. Replace example.com with the domain of your site.

    spot generate example.com
    cd example_com
    bundle install
    spot init
    spot server

and get started hacking the schema for your site...