Shakespeare is a Ruby on Rails content manager plugin.
- User-editable page titles, descriptions, meta info and content blocks for dynamic requests
- User editable content-only pages
Shakespeare is a super simple bolt-on CMS for any Rails app.
Shakespeare is easy to install.
As a plugin:
./script/plugin install git://github.com/paulca/shakespeare.git
Or as a gem. Add this to your environment.rb:
Then generate the migration to create the pages table:
And run the migration:
Once Shakespeare is installed, every controller action can now have its own content. You an access this content in the controller or the view with the
In your views, you have access to a number of helpers for generating your page meta-data.
page_titleis the title of the page
keywords_meta_taggenerates a tag for the page keywords, or returns nil if it's left blank
description_meta_taggenerates a tag for the page description, or returns nil if it's left blank
robots_meta_taggenerates a tag for the robots no-index and/or nofollow meta tag options, or returns nil if it's left blank
canonical_link_taggenerates a tag with the canonical URL for the page, if
enable_canonicalis set to true
You also get access to route helpers:
admin_pages_urlpoint to the pages admin interface
Using Rails' Engines feature, Shakespeare comes with a web interface that is available to your app straight away at
By default, this comes with no styling, but you can create a layout in
app/layouts/admin.html.erb, or set a layout by setting
For example, to use your standard application layout, create a
config/initializers/shakespeare.rb like this:
Shakespeare::Settings.layout = 'application'
You can also add before_filters to protect the controller from outsiders:
Shakespeare::Settings.before_filters << 'require_admin_user'
By default, in production, if
Shakespeare::Settings.before_filters is empty,
/admin/pages is protected. You can disable this protection by setting
Behavior::Settings.allow_anonymous to true.
By default, pages can be accessed at "http://localhost:3000/pages/URL" ...
@page.content is formatted with Rails's
You can choose not to format it with:
Shakespeare::Settings.format_method = nil
Or a choice of your own:
Shakespeare::Settings.format_method = 'textilize'
Running the tests
You can run the tests by checking out the code into vendor/plugins of a Rails app and running:
It also comes with a set of cucumber features:
I'm Paul Campbell. I'm an avid Ruby on Rails web developer. Follow my ramblings at http://www.pabcas.com
Follow me on Twitter http://twitter.com/paulca
Copyright (c) 2009 Paul Campbell, released under the MIT license