Getting started
Ben Giddings
bg-hobix at infofiend.com
Wed Sep 22 17:04:19 EDT 2004
Here are some issues I had starting up which are probably ones others
have seen and should probably be either fixed, or become FAQs:
I've answered the questions as best I could with what worked for me, but
there may be better answers or something else. Please feel free to tune
and improve.
Q: I created a blog but when I went there, there was nothing there, what
gives?
A: You need to run "hobix regen blogname"
Q: Ok, I created the blog, ran "hobix regen blogname" but there are
entries there!
A: Yeah, there are entries there by default
Q: Ok, so how do I get rid of them?
A: Just delete the files in entries, and regenerate the entries
Q: Ok, I did that but when I tried to do "hobix regen blogname" it gave
me an error. What gives?
A: Oh, well hobix needs at least one entry. Create one with "hobix post
blogname entryname"
Q: Great! Now the only entry is mine. But... hrm... the links all try
to go to bokononist.hobix.com. That's not my site!
A: Aha, you're making progress, but now you need to fix hobix.yaml in
the base of your blog directory. Change the "link: " line so it's right
for your site.
Q: Ah, great. That worked. I also fixed the title and tagline while I
was there. That helped a lot. But I'm not seeing the sidebar? I'm
using the 'apache2-ssi' thingy. What am I doing wrong?
A: Oh, well by default apache only parses .shtml files, not .html ones.
You'll either need to change hobix to generate shtml files, or change
apache to parse .html files
Q: Ok, well I changed apache, but now I get a message "[an error
occurred while processing this directive]" when I try to use my blog. I
guess that's where the sidebar should be.
A: Right, you're probably using a URL with a path on it. Right now
there's a "lib/local.rb" file that assumes you don't have a path.
There's no really clean fix for that now.
Q: Ok, well I just changed that file and it works, I see the sidebar,
but man, are things oogly! How can I make it purdier?
A: Well, if you just want a few tweaks, you can add lines to the files
ending in .quick or .quick-archive in the "skel" directory. For
example, I like my dates in the ISO8601 format, and think the title of
the entry makes a better link than the time, so I have an
entry.html.quick that looks like:
entry_title: |
<a href="<%= entry.link %>"><h3 class="entryTitle"><%= entry.title
%></h3></a>
<% if entry.tagline %>
<div class="entryTagline"><%= entry.tagline %></div>
<% end %>
entry_footer: |
<%= weblog.authors[entry.author]['name'] %>,
<%= entry.created.strftime( "%Y-%m-%dT%H:%M" ) %>
If you want more control over the look you can create ERb or Redrum
templates. Here's what I'm working on for an erb template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= weblog.title %> (<%= weblog.tagline %>)</title>
<style type="text/css">
@import "/site.css";
</style>
</head>
<body>
<div class="titleBar">
<h1 class="entryTitle"><%= entry.title %></h1>
</div>
<div class="entryBody">
<%= entry.content.to_html %>
</div>
<div class="entryDate">
<%= entry.created.strftime("%Y-%m-%dT%H:%M") %>
</div>
<p>
<% if page.prev %>
< <a href="<%= page.prev %>">previous</a> |
<% end %>
<a href="<%= weblog.link %>"><%= weblog.title %></a>
<% if page.next %>
| <a href="<%= page.next %>">next</a> >
<% end %>
</p>
</body>
</html>
Q: Wow, cool. I think I'm getting the hang of this. If I customize my
styles.css file that should make things really purdy, and the rest of
the customization can go in the templates, right? How do I know what
variables and methods are available?
A: "ri" is your friend. The main variables you'll want are "page",
"weblog" and "entry". Try ri Hobix, ri Hobix:Entry, ri Hobix::Page or
ri Hobix:Weblog
Q: Ok, I see how that works, or should work. Only for me, ri Hobix says
"The LinkList class is an entry type for storing links...". and ri
Hobix::Entry says: "More than one class or module matched your request.
You can refine your search by asking for information on one of:
Hobix::EntryEnum, Hobix::Entry"
A: [sound of crickets]
Q: Well anyhow, I can just look at the ruby files. They're pretty easy
to read. Things are going pretty well, only, for some reason my "next"
and "previous" links don't work. They don't go to
http://mysite/myblog/entry.html but to http://mysite/entry.html
A: [sound of crickets]
Q: Oh yeah, and if I wanted to use a redrum thing, how would I do that?
A: [sound of crickets]
Q: Hmm... Ok, well I'll come back later.
A: [sound of crickets]
More information about the Hobix-is-the-way
mailing list