== Hobix Tip: The Master Quick Template ==

Thankyou for your patience, OSCON kind of swallowed me up for several weeks there. William, Frederick, Leon, MenTaL -- you guys are handy to have around.

At long last, the Quick template is readily accessible. And, for that matter, the general problem has been solved. Plugin config can be saved in their own files.

=== Plugin Setup ===

Plugins may now have a `setup' method, which is called only once (when the blog is created.) The Hobix::Out::Quick class, for instance, creates a file called `hobix.out.quick' in the weblog's directory (right next to the hobix.yaml.) If this file exists, the plugin won't create it.

This means that those of you who currently lack a master template can create it by doing:

 >> require 'hobix/weblog'
 >> weblog = Hobix::Weblog.load( '/path/to/hobix.yaml' )
 >> weblog.setup

Plugins can optionally store their configuration in files named similarly to their path. Slashes are replaced by dots. So the `hobix/publish/ping' settings can be stored in `hobix.publish.ping'. Just a YAML file.

Or you can split up settings between the hobix.yaml and the plugin's config file.

=== The Quick Master ===

The `hobix.out.quick' contains the master template, but it can be deleted safely, it's not required. If can be safely modified as well. You can have it contain only your specific overrides.

Basically, Quick templates overlay the master.  Here's the overlay order:

  Hobix::Out::Quick         Hobix::Out::Quick
*_erb methods => redefinitions in lib/local.rb => hobix.out.quick => skel/*.quick

So, ultimately, the master lies in the Hobix::Out::Quick class. But you can override it in lib/local.rb, if that suits your style. Since the default `hobix.out.quick' contains a full template, it masks any of those settings and acts as a master, unless you delete it or portions of it. From there, individual pages can be customized in skel.

I like this change. You now have easy access to the master. And there's no danger of Hobix affecting your blog's appearance when upgrades happen.

_why
_______________________________________________
Hobix-is-the-way mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/hobix-is-the-way

Reply via email to