Bricks are extension modules for zena. There is a list of standard bricks that come included with zena. The file config/bricks.yml is used for basic brick enabling and settings.
If hosting only a single website, you can use the “single” brick to let zena keep the full-page cache in the standard “public/” folder. (Only needed if you have a non-customizable passenger setup, or the webserver won’t follow symlinks.)
- Enable the “fs_skin” brick
- Export a skin (turn dev mode “on”, go to the skin’s page, in the dev
box there is an “export” link)
- Save the skin in the “bricks” directory with the following content. Here is an example brick with two skins, “foo” and “bar”:
$RAILS_ROOT/bricks/myskins + zena + skins + foo + bar - Node.zafu (master template)* - Page.zafu (master template)* - _ding.zafu (partial) - dict.en.yml (translations) + static - bar.css - logo.png
The static/ directory is for the assets. In this example, the files will be available under the url path /static/myskins-bar/.
- Adapt all your templates to include from to each other properly like this:
Relative path: <r:include template='Node'/> or <r:include template='Classdir/_partial.zafu'/> Absolute paths need to include the skin name: <r:include template='/skin_name/Node'/> Absolute paths to filesystem skins start with a "$" and a name like this: <r:include template='$brick_name-skin_name/Node'/> (e.g. '$myskins-foo/Node')
- Adapt the skin references to assets to correctly point into the brick. For example:
fs_skin assets: <link href="/static/myskins-bar/bar.css" rel="Stylesheet" type="text/css"/>
- Turn your brick “ON” in config/bricks.yml
- Create a skin node, go to the ”++” tab in its edit popup and set the z_static field to “myskins-bar”. (Do this for each skin in the brick. In the example, foo and bar.)
rake fs_skin:indexin order for zena to link the “master templates” in the filesystem skins to the corresponding virtual
classes. It also updates the “public/static” folders of all sites, that contain symlinks to the folders inside the bricks: (public/static/myskins-bar -> bricks/myskins/zena/skins/bar/static)
- Assign your filesystem skin to nodes or sites as desired.
- After modifying a skin, you have to request the page it renders with
?rebuild=true, to trigger zafu cache rebuilding for the templates used to render the requested page. (The dev-mode overlay provides a button for this.) You may also use
$ rake zena:clear_zafuto clear the entire template cache.
Implements delayed jobs in zena.
(requires???: gem install delayed_job—version=1.8.4)
Usage example: free-text searching