/scanty

The blog that's almost nothing - now using CouchDB

Primary LanguageJavaScript

Scanty, a really small blog, now on the couch

Overview

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.

Features

  • Posts (shock!)

  • Tags

  • Markdown (via Maruku)

  • Ruby code syntax highlighting (via Syntax)

  • Atom feed

  • Comments via Disqus

  • Web framework = Sinatra

  • ORM = CouchRest

Dependencies

$ gem install sinatra

Maruku, Syntax, and CouchRest are vendored.

Setup

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:

$ ruby main.rb

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.

Database

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

for more information on CouchDB, check out the rest of the wiki at wiki.apache.org/couchdb/ or the homepage at incubator.apache.org/couchdb/

Comments

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.

Import data

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.

Extras

I’ve added a few more features which weren’t in the original Scanty:

  • 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.

  • 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.

Customize

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.

Meta

Written by Adam Wiggins

Patches contributed by: Christopher Swenson Forked by: Joel Tulloch

Released under the MIT License: www.opensource.org/licenses/mit-license.php

github.com/adamwiggins/keen

adam.blog.heroku.com/

blog.jtulloch.com