Scanty, a really small blog, now on the couch
Scanty is blogging software. It was created by Adam Wiggins for his blog: adam.blog.heroku.com
The main thing that has been changed with this version is the data-access. Rather than his default of Sequel, and a SQLite database, I have used CouchRest for accessing a CouchDB database.
It is not a blogging engine, but it's small and easy to modify, so it could be the starting point for your blog, too.
Markdown (via Maruku)
Ruby code syntax highlighting (via Syntax)
Comments via Disqus
Web framework = Sinatra
ORM = CouchRest
I like bundled gems, so this scanty utilisese bundler.
$ gem install bundler $ gem bundle --cached
Change the Blog config struct in config/app_config.rb to your liking. For security purposes, change the admin password and the admin cookie key and value. These last two can be set to any random value you like, just choose something other than the default.
Then run the server:
$ bin/thin start -p 4567 -R config/rackup.ru
And visit: localhost:4567/
Log in with the password you selected, then click New Post. The rest should be self-explanatory.
In production, you'll probably want to run “rake start” to start (and restart) the server.
This version of Scanty uses CouchDB. If you use the default CouchDB set-up, then you should only need to alter the database_name in the Blog config struct in main.rb. Otherwise, add the base-url of your CouchDB instance to url_base_database in the struct. If the database doesn't exist, it will be created automatically.
for installation instructions, find your platform on the following page: wiki.apache.org/couchdb/Installation
Gentoo has CouchDB 0.10.0 in portage now.
There are no comments by default. If you wish to activate comments, create an account and a website on Disqus (disqus.com) and enter the website shortname as the :disqus_shortname value in the Blog config struct.
Christopher Swenson has a Wordpress importer: github.com/swenson/scanty_wordpress_import
Other kinds of data can be imported easily, take a look at the rake task :import for an example of loading from a YAML file with field names that match the database schema.
I've added a few more features which weren't in the original Scanty:
there is now a checkbox when creating or editing a post which determines whether the post will be published. you will only see the unpublished posts when signed in. this allows unfinished posts to be saved without worrying about copying and pasting, etc.
the ATOM feed now creates a separate feed URL for each user. The last_access property is updated for each user, whenever the feed is accessed. this allows the number of readers to be tracked, and old users to be removed, providing better accuracy.
As I couldn't get it to work. I think the before create callback is broken in couchrest.
Works with CouchDB 0.9.0+ & couchrest 0.34
There are no themes or settings beyond the basic ones in the Blog struct. Just edit the CSS or the code as you see fit.
Written by Adam Wiggins
Patches contributed by: Christopher Swenson Forked by: Nicholas Orr
Released under the MIT License: www.opensource.org/licenses/mit-license.php