Canticore – A new look at blogging engines.

I’d like to talk about blogging for a bit. I know, it’s a horrible subject that’s been done to death, but I began working on a project recently that I hope will try to provide a clean, simple, robust solution for the next generation of bloggers and programmers.

It’s called Canticore. It’s written in Ruby, and has the features I want in it, but this feature list may be common to a lot of people.

  • (Multi)Markdown support
  • Aggressive Caching
  • Threaded comments
  • Multiple users
  • Painless upgrade
  • Rich RSS (by category, post, tag, comment)
  • Static pages
  • Support for common blogging APIs (Blogger, metaWeblog, Movable Type)
  • Syntax Highlighting
  • Trackbacks
  • Web administration

The most important feature is one that I think will make the difference. Plugins and themes are RubyGems. That’s it. That’s the killer thing. That’s what’s most important to me. I sat down and knew I wanted hooks and filters, themes, all that good stuff, but as I worked on the domain for those things, I realized RubyGems did everything I wanted my plugins and themes to do: simple versioning, metadata, easy installation and painless upgrading. So that became my new goal.

At this point, the codebase is a bit of an uncommented mess, but it has everything in place to make my goals work. This early announcement was pre-empted by two things: Matt’s removal of themes from wordpress.org, and GitHub’s announcement of their new feature, GitHub Pages: the former, because theme and plugin submissions on canticore.org will be provided with the ability to choose a license upon submission, and the latter because people might flock to that instead of looking for alternatives :-)

The repository is available at GitHub, along with the official website repository, some plugins to ensure certain functionality is baked in, and the first theme, called default.

I’ve secured a gorgeous place for people to upload gems that they create. I was considering creating a sub-reddit for this purpose, and not do any of this work, but I also wanted a demo server for people to try out themes that interest them. If you’re interested in contributing, or having a say in the next feature, or want to file bugs or tests, join the conversation! I want to make something exciting and beautiful, but I know I may not have the time to do it alone, anymore.

For people interested in how it works for plugin and theme developers, keep reading.

Plugins

Imagine being able to write a blog plugin with proper object-orientation! :-) Plugins have an extremely simple syntax that you can pick up just from reading a sample.

  require 'canticore/plugin'
 
  Canticore::Plugin::Create 'theme-changer' do
    enhances :index
    variable :before_text, 
      { :summary => "Dropdown Prefix Text", 
          :desc => "Text to display before the drop-down.",
          :default => "Change Theme: " }
 
    def output
      haml :output
    end
 
    hook :body, :output
 
  end

The #enhances block tells the blog what pages the plugin should be enabled on: :index just means it will be enabled on the landing page, and not archive pages, individual post pages, static pages, et cetera. You can also use enhances :all for a blanket enabling.

Each variable you want the user to change and be able to save to the database begins with a #variable function. Give it a name and a list of options.

Hooks are where you attach your functionality to Canticore. Right now there’s only a few, :body being one of them. The line hook :body, :output tells Canticore to attach the output of the function called :output to the body hook. You can use HAML for your plugins, in this case the function output looks for a file called views/output.haml in your plugin gem to render.

Filters are coming.

Themes

Themes are designed in HAML and can use SASS and plain old CSS. You need certain layout pages for your theme to be valid:

  • archive.haml for archive listings.
  • index.haml for the landing page of your blog.
  • layout.haml for the global layout.
  • page.haml for static page content.
  • post.haml for individual post pages.
  • _entry.haml for what a post will look like when displayed in a listing.

And that’s it! Static content goes in your gem under static, and stylesheets go under stylesheets, whether or not they’re SASS or CSS. Canticore is smart enough to figure it out. The name static/snapshot.png is reserved for the screenshot you want to take of your theme to display to users on canticore.org and in Canticore’s administration panel.

5 Comments

  1. Posted December 20, 2008 at 2:29 pm | Permalink

    Remarkable. Canticore seems very impressive and I like the idea of using gems as plugins. If you are planning on using canticore.org as a central repository then, you’re definitely on the right track.

    An idea? Provide migration scripts from Typo, Mephisto, Wordpress etc.

  2. Posted December 20, 2008 at 2:45 pm | Permalink

    I hope I’m not the only person that:

    1) is very exited to give this a try.

    2) has no idea how to actually do it after reading the getting started page on the wiki.

    Regardless I am subscribed and following on github. Looking forward to giving it a whirl.

  3. Posted December 20, 2008 at 4:37 pm | Permalink

    install canticore:

    http://github.com/ardekantur/canticore/tree/master

    install canticore-theme-default:

    http://github.com/ardekantur/canticore-theme-default/tree/master

    create a ruby file like the one in the getting started page, call it blog.rb or something

    run it: ruby blog.rb

  4. Posted December 20, 2008 at 9:11 pm | Permalink

    This looks exciting! I’m really unimpressed with Typo and Mephisto, so I’m really interested in seeing this become successful. I’ve forked it on github so I can play around and try to contribute.

  5. Posted December 23, 2008 at 4:32 am | Permalink

    Nice idea. Out of curiosity, is it currently able to handle multiple sites with a single installation ? (like: 3 domains served by the same app ?)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*