Hobix

This weblog runs on Hobix, a neat little weblog system written by why the lucky stiff and others. It builds upon Ruby – my favorite programming language, YAML a very simple metadata language and Textile – my favorite markup language.

Quick! Quick! For the impatient

Here a very short how-to install Hobix on your system. Please make sure you know what you are doing, we’re deleting a lot of files, please double-check your parameters. If you’re not feeling comfortable, you could move them to another directory instead of deleting them.

  1. Download Hobix via SVN
    svn co http://code.whytheluckystiff.net/svn/hobix
  2. Install it
    cd hobix/trunk && sudo ruby setup.rb
  3. Remove the old RedCloth version from the lib-directory Hobix got installed to (if it’s there). If you’ve installed Hobix in /opt/local use
    sudo rm /opt/local/lib/ruby/site_ruby/1.8/redcloth.rb
  4. Create a Weblog
    hobix create WEBLOGNAME /path/for/the/files
  5. Remove the entries from there. The entries are old, and wrong, just get rid of them with
    rm -rf /path/for/the/files/entries/*
  6. Make sure you have RedCloth installed via RubyGems
    sudo gem install RedCloth
  7. Make sure your gems are available, by running
    irb -rredcloth
  8. Customize your weblog template
    vi /path/for/the/files/hobix.out.quick
  9. Write an entry
    hobix post WEBLOGNAME ENTRYNAME
  10. Re-Generate your site, if it’s not done after posting
    hobix regen WEBLOGNAME
  11. There is no step… what was it again?

Below is a longer explanation of the installation, and a little more.

Setup

Installing Hobix was a pain. I had to download the Subversion trunk, and install it by hand. There may be a gem available for 0.5, but currently that’s the way to go. You could also try to install 0.3 or 0.4 from go.hobix.com, but that didn’t work for me.


svn co http://code.whytheluckystiff.net/svn/hobix
cd hobix/trunk
sudo ruby setup.rb

You’ll get asked to enter your data, but skip creating or adding blogs for now.

Next, you should make sure that you’ve got the latest RedCloth (for example via RubyGems), and – that’s important – make sure that Hobix didn’t install it’s own (outdated) version. For example I’ve installed Hobix in /opt/local, and had to delete /opt/local/lib/ruby/site_ruby/1.8/redcloth.rb because it lead to a stack overflows on longer paragraphs.

Concerning RubyGems: I had to manually add export RUBYOPT=rubygems to my ~/.profile to get RubyGems up and working without programs (Hobix for example) knowing it. It’s very well possible that your installation is already set up, check it with irb -rredcloth, if you get an error, add it to your .profile and source it.

Configuration

The data you inserted earlier (Name, Mail etc) is stored in your ~/.hobixrc. This file also holds information on all your Weblogs. Check the file, and delete the user you.

Now we’re ready to create our first Hobix-Weblog. Just type hobix create WEBLOGNAME /path_to_your_weblog/ accept the defaults and we’re done.

Each weblog is configured in /path_to_your_weblog/hobix.yaml, this file contains the title, base URL (link) and some other information about your weblog. Edit it to suite your needs. Hobix supports plugins, but I won’t cover them here.

The demo entries that come with Hobix were broken, so delete them. rm -rf /path_to_your_weblog/entries/*. Yes, pretty hard, but get rid of them, they caused me a lot of trouble.

You can easily create a few demo postings using hobix post WEBLOGNAME ENTRYNAME.

Usually Hobix opens an editor (eg vi) with a template, if you like you can use this one:

 --- !hobix.com,2004/entry
 title: TITLE
 tagline: SUBTITLE
 author: YOURNAME
 tags:
   - tag1
   - tag2
 summary: |

   something

 created: 2006-08-10T23:57:20
 content: |

   more of that

If you know some YAML it’s no problem to understand these lines. title, tagline, author, summary and content are strings. summary and content can go over more lines, but have to be intended. tags is an ordered list of strings, and created is a date.

After that Hobix should be able to generate you site. In fact it should do it automatically after each post command, but you can manually start the generation of you weblog using hobix regen WEBLOG.

Now you should have a HTML version of you weblog in /path_to_your_weblog/htdocs, open it in a browser and have a look.

Writing an entry

This, at least, is simple. Just type hobix post category/entryname. Your editor (configured via the EDITOR variable in your environment) opens up with a simple template and you’re ready to go.

Each entry has a subset of these parts:

title The title of your entry. Required.
tagline A subtitle for your entry.
author Your name, must match a configured name in .hobixrc. Required.
summary A summary for your entry.
tags Some tags – as YAML array.
created The create date – used to sort the entries. Required.
content The full content. Required.

Telling Hobix what to generate

Hobix has an interesting way to generate the content. You simply put (mostly empty) template files into your /path_to_your_weblog/skel directory. Each filename has three parts what.outputformat.method.

For example index.html.quick tells Hobix to generate index files with the html extension using it’s quick templates (you shouldn’t use anything else than quick, or it’s derivatives). If you leave the file empty Hobix uses it’s default way to generate the content.

All of these three parts are extensible using plugins. In stock Hobix you can choose:

For the what:

index For index/overview pages. Containing the last 10 entries.
montly For monthly overviews. Containing all entries of that month.
yearly For yearly overviews. Containing all entries of that year.
tag For tag overviews. Containing all entries with that tag.
section For section overviews. Containing all entries of that section.
entry For the entry page. Contains only one entry and is called like you called it at posting (hobix post WEBLOGNAME ENTRYNAME).

The outputformat is only the extension for the files.

The method is one of:

quick For HTML.
quick-summary For HTML, showing the summary instead of the full content. Somewhat obsolete.
quick-archive For HTML, rendering entries for the archive pages. Somewhat obsolete.
okaynews For YAML.
rss For RSS.
atom For Atom.

Note that you can’t have two files with the same first two parts. For example index.html.quick and index.html.atom would not work because Hobix would genereate two index.html files in the same directory.

After a hobix regen WEBLOGNAME you’ll have the new files available.

I usually configure my blog like this:

   50 entry.html.quick
    0 index.atom.atom
  250 index.html.quick
    0 index.xml.rss
  250 monthly.html.quick
  250 section.html.quick
  250 tags.html.quick
  250 yearly.html.quick

Most of the layout can be configured in /path_to_your_weblog/hobix.out.quick which is a YAML/ERb combination. The file itself is pretty self-explanatory (again YAML). Just start with the page section.

You may have noticed that the skel files are pretty small, that’s because quick templates have a hierarchy. Everything defined in hobix.out.quick can be overwritten in part or whole in each of the skel files. If you don’t hava a hobix.out.quick and the skel files don’t define something, you’ll get the hardcoded Hobix defaults.

For example you could configure index.html.quick to display only the summary if one exists instead of the full-content by putting this into that file:


entry_content: |
  <div class="entryContent">
    <% if entry.summary %>
      <%= entry.summary.to_html %>
      <p><a href="<%= entry.link %>">Continue to full post...</a></p>
    <% else %>
      <%= entry.content.to_html %>
    <% end %>

Now Hobix loads the configuration in hobix.out.quick, but overwrites the entry_content with the one specified in index.html.quick when it generates the index files.

Coming to an end

Please check these two tutorials too I’m sure I’m missing a lot of details which may be covered there: Tutorial1 and Tutorial2 the Hobix mailinglist is also a good source for information and tricks.

Looking at the tutorial I would never go through Hobix. It really looks like a mess, but on the other hand you’ll have a pretty powerful and elegant system in your hands.

You can generate the content of your blog on your home-machine and upload the static files to any Web-hoster you like. There are no security leaks coming from Hobix (as long as you stick with the static files)!

It’s super high performance – what’s faster than serving static files?

Comments are available with Hobix too, but only if you install it on a server. I didn’t look at them right now – maybe there are more problems upon me.

I really like Hobix’ way of dealing with content, if I define a tagline it gets presented, if I don’t it doesn’t matter. The same with the summary, if I define one I’ll get it on my index-page, if I don’t Hobix shows the full content. If I’d like I could also limit the size of the full content on the index pages to some arbitrary size… .

Ahh, and tags – hmm, good. Hobix allows you to define sections and tags. If you define a section for an entry, it’s also a tag for it. So, maybe it’s best to stick with tags instead of mixing them?

If I ever wish to move to a Weblog-hoster again, I can simply take my YAML files and post them to the new system using any Weblog-API – nothing gets lost, no lock-in.

Using Hobix I can use any Web-server statistic software available on the net. I don’t have to rely on simplified statistics from the Weblog-software (or use some other statistic service like Google analytics). If I want to I can check the logfiles directly.


Hobix is a new coat, but it’s really funky, you gotta be adventurous and intrepid. You have to be able to do a triple front-flip without using your legs at all. If you use Hobix and you can’t do a triple front-flip without using your legs, then you will go to Federal prison. Because you’re almost definitely pullin other heists that are unpaid, comin after ya. —_why about Hobix

Comments