Robin CMS
[!IMPORTANT] This software is currently in beta. There may be bugs and breaking changes. If you find a bug, I'd love to hear about it.

Robin CMS is a minimalist flat-file CMS built with Ruby and Sinatra. It is designed to be used by developers for creating custom built websites where the client needs to be able to update content themselves. It works with any Static Site Generator and can also be embedded in a dynamic Sinatra app. The idea is that you can just drop it into your project and it gives you a completely customised CMS for your website.
It is completely headless - it gives clients an admin interface where they can manage raw content, while giving the developer full control over the HTML and CSS. That way clients can't accidentally break layouts and design.
You can define the content model of your website using a YAML file. That way you don't have to wrangle all your data into a "blog" post. You can choose to store content either as HTML (predominantly for content with rich text), or YAML for structured key-value data.
Robin CMS is designed to keep things as simple as possible. It uses files to
store data so you don't have to worry about managing a database. The entire CMS
can be installed with just two files - a two line config.ru file and a
_cms.yml configuration file.
Motivation
I know, I know. Another CMS. Whilst there seems to be a plethora of options in PHP and JavaScript, there aren't many options for Ruby. Most of them are big Rails monoliths, designed either to be a full end-to-end CMS like Wordpress, or for the specific use-case of building a blog. I couldn't find a simple headless, flat-file CMS built in Ruby that met my needs. So here we are.
Features
- Headless, flat file CMS
- Define custom content model using a YAML configuration file
- Store content as files in HTML or YAML format
- Works with any Static Site Generator or with a dynamic Sinatra app
- Simple to install into your website - you just need to add a
config.ruand a_cms.ymlfile - Self-contained - you don't need to ship any assets for the CMS admin site
Limitations
In order to keep the CMS simple to maintain for your website, certain features that are commonly found in CMS software have been omitted.
- Only supports a single user, which means you don't need to maintain a user database.
- Does not support relations between content models. This is the nature of a flat-file CMS. If you need data model relations, you are probably better off using an SQL database backend rather than a flat-file backend.
- Doesn't support multiple sites. It is designed to be simple enough that you can drop in a separate instance of the CMS for each website.
- Does not have a WYSIWYG editor. It is designed purely for managing structured content. You can however add richtext fields to your content models (see example below).
Usage
Robin CMS is packaged as a Ruby gem, so installation is as simple as
gem install robin_cms
It's possible to use the CMS in a few different ways. You can use it as a standalone CMS for any Static Site Generator, you can embed it in a dynamic Sinatra app, or you can use it as a Jekyll plugin. If you're already using Jekyll as your SSG, this is the simplest approach.
See the documentation for further information on usage.
Configuring
Your content model is defined in a single YAML file. It acts as a sort of schema for your content. An example YAML file looks like this:
url: https://example.com
title: Example
libraries:
- id: poem
type: collection
label: Poem
location: poems
filetype: html
fields:
- { label: Title, id: title, type: input }
- { label: Author, id: author_name, type: input }
- { label: Content, id: content, type: richtext }
- id: book
type: data
label: Book
location: books
filetype: yml
fields:
- { label: Title, id: title, type: input }
- { label: Author, id: author_name, type: input }
See the docs for more details on configuration. You can also find some examples here.
Testing
Unit test are written in RSpec. To run them:
rake test
Roadmap
- [ ] Support markdown content
- [ ] Support alternative serialization formats (json, csv, tsv)
- [ ] Filter by any "select" field type
- [ ] Descriptions at the field level
License
The gem is available as open source under the terms of the MIT License.