Scribo

A easy to use, embeddable CMS for Ruby on Rails. Scribo is designed to work with your models and can also render your content inside customer designed layouts.

Features

Scribo is designed to be easy to use and we try to keep it as simple as possible. It's designed to have the least possible impact on your database, we only use two models/tables (Site and Content). It also makes no assumptions about your data models, it does come feature packed though:

  • Pages
  • Blog (with permalinks & categories)
  • Static assets
  • Data files (think: make a page based on an Excel sheet)
  • Layouts
  • Liquid templating
  • Mostly Jekyll compatibile
  • Use of YAML in front-matter and configuration
  • Use of Jekyll themes
  • Online editor:

Online Editor

Documentation

  • YAML cheatsheet
  • Quick YAML introduction

API

The API uses token authorization, the token is obtained by making an sgid from the scribable. So for a scribable model Account, you could create it as follows:

token = Account.first.to_sgid(for: 'scribo', expires_in: nil).to_s

This token can be used in the below request.

POST /api/sites/import

This allows you to import a site (in ZIP format) using an API token.

curl -H 'Authorization: Token {token}' -X POST -F 'files[][email protected]' https://endpoint/api/sites/import

Installation

Add this line to your application's Gemfile:

gem 'scribo'

Run the installer:

$ bin/rails g scribo:install

Using your controllers with scribo

In your controller add the following:

render(scribo: current_site, path: '/index', restricted: false, owner: Account.first)

This will look for index in the current_site.

Testing

bin/rails db:drop bin/rails db:create bin/rails db:migrate

The admin side of Scribo can be accessed here: https://localhost:3000/sites/ Run yarn watch and you can develop using the above URL.

Contributing

Bug reports and pull requests are welcome on GitHub at https://gitlab.com/entropydecelerator/scribo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.