From bowman at mazirian.com Mon Apr 10 09:08:08 2006 From: bowman at mazirian.com (Bradford R. Bowman) Date: Mon, 10 Apr 2006 09:08:08 -0400 Subject: Skel files again Message-ID: <1144674488.20412.28.camel@phandaal> I installed hobix from svn about a month ago and I am working on customizing the html generated for the index page. I would like entries from different categories to have different html (basically be wrapped in different divs) on the index page. I thought this would be easy, but the solution is eluding me. In skel/ I have: index.atom.atom index.html.quick index.xml.rss monthly.html.quick-archive recipes/ books/ So far I have only edited index.html.quick, in which I have heavily customized the layout of the index page, including the quick template for "entry". Those changes are working nicely. But say I want entries from the "recipe" category to look different from those in the "books" category, what do I do? I tried adding entry.html.quick and, alternatively, entries.html.quick to skel/recipes/, but neither of those had any effect on the entries that are generated in forming the index page. Any ideas? Thanks, -- Bradford R. Bowman GnuPG Public Key available at: http://mazirian.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20060410/3fc5c442/attachment-0001.bin From bowman at mazirian.com Mon Apr 10 22:43:03 2006 From: bowman at mazirian.com (Bradford R. Bowman) Date: Mon, 10 Apr 2006 22:43:03 -0400 Subject: Skel files again In-Reply-To: <1144674488.20412.28.camel@phandaal> References: <1144674488.20412.28.camel@phandaal> Message-ID: <1144723383.14069.46.camel@phandaal> On Mon, 2006-04-10 at 09:08 -0400, Bradford R. Bowman wrote: > I would like entries from different categories to have different html (basically be wrapped > in different divs) on the index page. I thought this would be easy, but > the solution is eluding me. To answer my own question, though I'm not sure it's will benefit anyone in particular, this is what I did in index.html.quick: entry_content: |
"> <%= entry.content.to_html %> etc... Or at least, that's the concept. The idea is to generate something of a tumbleblog, with different categories of entries styled differently. Let me know if you have a more clever idea, as I am not by any means proficient with ruby...yet. -- Bradford R. Bowman GnuPG Public Key available at: http://mazirian.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20060410/eacc1d90/attachment.bin From why at hobix.com Tue Apr 11 11:27:08 2006 From: why at hobix.com (why the lucky stiff) Date: Tue, 11 Apr 2006 09:27:08 -0600 Subject: Skel files again In-Reply-To: <1144723383.14069.46.camel@phandaal> References: <1144674488.20412.28.camel@phandaal> <1144723383.14069.46.camel@phandaal> Message-ID: <443BCACC.5000806@hobix.com> Bradford R. Bowman wrote: > To answer my own question, though I'm not sure it's will benefit anyone > in particular, this is what I did in index.html.quick: > > entry_content: | > >
"> > <%= entry.content.to_html %> > etc... > > Or at least, that's the concept. > Yeah, I would say that's a much better idea than what I was going to offer. Two things that spring to mind: * You might try using <%=entry.tags * " "%>. The list of tags includes the category and any tags you've given the entry. It might be nice to style based on tags. * If you decide that you need to layout entries totally differently, based on their content, you can subclass Hobix::BaseEntry. If you look in hobix/entry.rb, you'll see an example in the Entry class. It's probably overkill, though, and you'd probably better off just using Textile to layout the entries. Good luck, let us know how it turns out. _why From elbart0 at free.fr Wed Apr 12 15:52:58 2006 From: elbart0 at free.fr (El Barto) Date: Wed, 12 Apr 2006 21:52:58 +0200 Subject: Skel files for entry Message-ID: <443D5A9A.6030302@free.fr> I tried to customize entries for a specific section as suggested by: http://rubyforge.org/pipermail/hobix-is-the-way/2005-August/000568.html and previous posts. But it seems possible only for 'index' pages, not 'entry' pages. First, I tried to put a dummy 'entry.html.quick' file in 'skel/mysection/' : --- !dummy but the file was not used (no error) when I regenerated the blog. Then, I tried to put a dummy 'index.html.quick-summary' file in 'skel/mysection' : --- !dummy and the file was loaded cause I got an error: /usr/local/lib/site_ruby/1.8/hobix/out/quick.rb:104:in `load': undefined method `each' for # (NoMethodError) What should I do to customize entries? From elbart0 at free.fr Sat Apr 15 04:52:37 2006 From: elbart0 at free.fr (El Barto) Date: Sat, 15 Apr 2006 10:52:37 +0200 Subject: Tiny bug with custom setup Message-ID: <4440B455.1030306@free.fr> I installed hobix with a custom configuration: $ ruby setup.rb --bindir=/usr/local/bin --datadir=/usr/local/share But 'hobix.rb' didn't take the specified 'datadir' into account. So I patched the file: --- /usr/local/lib/site_ruby/1.8/hobix.rb~ 2006-04-02 10:17:06.000000000 +0200 +++ /usr/local/lib/site_ruby/1.8/hobix.rb 2006-04-02 10:25:58.000000000 +0200 @@ -212,7 +212,7 @@ CVS_ID = "$Id: hobix.rb 124 2006-03-24 23:44:03Z why $" CVS_REV = "$Revision: 124 $"[11..-3] ## Share directory contains external data files - SHARE_PATH = "#{ ::Config::CONFIG['datadir'] }/hobix/" + SHARE_PATH = "/usr/local/share/hobix/" ## Get a top-level constant from a string def self.const_find( tclass ) May be the 'hobix.rb' should be automatically configured during installation process. Do you want me to add an entry in the Bug Tracking System?