Your new weblahh is restless. It’s legs are cramping up. Hurry, put on some exercise music.
Two ways of saying what you need to say on your weblahhhag. You can use the commandline:
hobix post blahhg shortName
This will create a new file named
shortName.yaml in your
entries directory. Assuming your weblahh is at
http://a-dog-a-log-a-bog.com/, this entry will be archived at
You may also organize your entries into category directories. Simply add the category path to the shortName.
hobix post blahhg news/shortName
The other way of saying what you need to say. You can simply create a new YAML file in the proper directory under
entries. Here’s a full YAML entry file:
--- !hobix.com,2004/entry title: Full Title of the Story author: author-username-here created: 2004-04-01 18:11:39 -05:00 tagline: A Brief Sentiment To Spark Interest summary: > Perhaps give a short teaser. Think hard. Have any fisticuffs in your entry? People love to duke it out. content: > !images/my-face-bruises.jpg! Yeah, wo. Quite a bit of bad, crazy fist-fighting. It's all in a day's work.
summary fields are optional. In fact, Hobix will add the
created field for you. The other two are only if you want to be extra professional circa 2050.
content field above. The
!images/my-face-bruises.jpg! line is a Textile command. Textile is a simple replacement for HTML.
This command places an image in the content. In Textile, images are
embedded by surrounding the image address in exclamation marks.
For more on Textile, see A Textile Reference.
So the default websyht is porridge. Absolutely rank.
To edit the look of things, hop into the
skel directory. You’ll see a set of files:
entry.html.quick index.atom.atom index.html.quick-summary index.xml.rss index.yaml.okaynews monthly.html.quick-archive section.html.quick-archive sidebar.html.quick yearly.html.quick-archive
Why do these files have more than one extension? Well, the
end extension indicates what plugin will process the file. For example,
index.html.erb file will be processed by Hobix’s
erb output plugin.
When the file is generated (using the plugin), the ending extension will be removed and the newly created file will be saved in
index.html. Nothin to it.
However, not every template creates only one new file. The
entry.html.erb file is responsible for creating all the archived entries throughout your site. If you have ten entries on your site,
entry.html.erb will be the template for all of these ten entries.
Each will have its own name, rather than just
entry is just a prefix, which indicates what the template will be used for.
Possible file prefixes are:
index -> the front page, last 10 entries generates htdocs/index.ext entry -> an entry's permanent archive, generates htdocs/category/entry-id.ext (htdocs/news/shortName.html) monthly -> a monthly archive of entries, generates htdocs/year/month/index.html (htdocs/2004/04/index.html) daily -> like above, but daily (htdocs/2004/04/12.html)
So let’s take
index.xml.rss as an example. This file will be passed to the
rss plugin of Hobix (
hobix/out/rss). The plugin will receive the last 10 entries, since the file’s prefix is
index. The file will then be save to
Yeah, so if you want to create rss feeds for every entry in the site, just add a blank file called
entry.xml.rss. Then update the latest on the blahhg:
hobix upgen blahhg
ERB is Embedded RuBy. Basically, you can place Ruby code between < and > tags. The code will be executed as the file is read. You can print a variable to the page with:
<%= var %>
Every ERB template is given three variables which you can use in Ruby:
The weblog variable is a
Hobix::Weblog object. This object contains all the information from your
hobix.yaml file. You can also search for entries and edit them through this object.
Generally, you’ll use it to display information about the weblahhg.
<title><%= weblog.title %> (<%= weblog.tagline %>)</title>
You could use the above in your
index.html.erb to see to it that your front page has the title and tagline of the weblahhg in the browser’s title bar.
variable contains a Hobix::Page object, information about the current
page. The latest update to any entry on the page is in the
This page last updated on <%= page.updated %>
The page variable also has links to the
current page, as well as the previous page and next page. This way you
can set up arrows to link to the previous month’s or next month’s page
The and links in this tutorial are generated like this:
<% if page.prev %> < <a href="<%= page.prev %>">last</a> <% end %> <% if page.prev and page.next %>|<% end %> <% if page.next %> <a href="<%= page.next %>">next</a> > <% end %>
The entries (or entry) variable contains one or more Hobix::Entry objects which have been loaded for the page. In the case of a template with an
entry prefix, only one entry is passed into the template at a time. This entry is placed in the
All other pages use the
entries variable, which contains an Array of Hobix::Entry objects.
The Hobix::Entry object has all the same properties as the YAML file we discussed in the last section. It also has an
id property (the entry’s
shortName) and a
link property (a URL to where the entry is permanently saved.)
index.html.erb, you might display the last 10 entries by iterating through the
<% entries.each do |e| %> <div class="titleBar"> <div class="entryTitle"><%= e.title %></div> <div class="entryDate"> <%= e.created.strftime( "%m %d %Y @ %I:%M %p" ) %></div> </div> <div class="entryBody"> <%= e.content.to_html %> </div> <% end %>
skel uncluttered. Templates only. I admit. I like to use Apache server-side includes. I keep them in
skel. Anything in
skel which isn’t recognized as a plugin is simply coped over to
htdocs when you regenerate.
skel limited to the very bones of your websyht. Store your images and other downloads in