image

RubyFrontier Documentation

User Settings

Frontier provided a way to let you make settings that would be in common for rendering all your Web sites (unless overridden by a setting within a site). For example, if you know that in a lot of different sites you’d like to say “apple” as a shortcut for “http://www.apple.com” in links, it seems silly to make you redefine this in a #glossary hash for every source folder. So you need a place where you can define “apple” to mean “http://www.apple.com” just once, and have this definition available in any page in any Web site you render.

To handle the need for such user settings, RubyFrontier provides the following mechanism. You provide a file — the user.rb file. (It doesn’t actually have to be named user.rb, but that’s the convention and that’s what I’m going to call it.) You tell RubyFrontier where it is by choosing RubyFrontier > Locate User.rb File. From then on, RubyFrontier remembers where this file is (on this computer).

Whenever you give a RubyFrontier command, such as Publish Page, as RubyFrontier is loading all the files where its code is kept, it loads user.rb last. This means that user.rb is your chance to add code to the RubyFrontier command’s Ruby world.

When file user.rb is loaded, here are the sorts of thing it can do:

Note concerning the “user templates”: Frontier had a mechanism of “user templates”; any templates kept in the user table could be referred to by name in any site. RubyFrontier imitates this only to the extent of including two “user templates” that can be referred to by name. But they are actually inside the RubyFrontier bundle and so the user templates mechanism is not really open to your use, unless you want to reach right inside the RubyFrontier bundle and put additional templates in there. In future, if there is demand, I am certainly open to restoring a more convenient user templates mechanism; but up to now I have not done so because I haven’t felt the need for it.

Next: Bundle Commands

This documentation prepared by Matt Neuburg, phd = matt at tidbits dot com (http://www.tidbits.com/matt/), using RubyFrontier.
Download RubyFrontier from SourceForge.