---
title:      Release 0.9.1
created_at: 2008-09-10 19:33:47.822421 -06:00
filter:
  - erb
  - textile
release_name: Gallus Gallus Toothicus
---
h2. <%= h(@page.title) %>

Release 0.9.1 adds one new significant feature and fixes some bugs. The big new feature is the ability to generate multiple output files from a single content page. See below for more information.

* 1 major enhancement
** Multiple output files can be generated from a single page
* 2 minor enhancements
** Pagination now honors the "page per directory" flag
** Simplified the handling of meta-data at the top of files
* 2 bug fixes
** Filename extensions were not being preserved when creating a new page
** Webby now works properly with rake 0.8.2

h3. Multiple Output Files

What's that, you say? Multiple output files, you say?

Why, yes!

Let's take the example of a photo gallery containing a page of thumbnails that each link to a larger picture with a title and a description. To make such a creation in webby would require each "large picture" page to have it's own file in the content directory, but the only difference between these files would be the _title_ and the _description_.

A better way to handle such a beastie would be a single file in the content folder that contains the titles and descriptions of *all* the photos in the meta-data. The content of this page would be filled in differently for each specific photo page generated.

This is now possible in webby by specifying the specifics for each photo in separate meta-data blocks at the top of the page. One output file will be generated for each meta-data block.

<pre>
<%= Webby::YAML_SEP %> 
title:       First Photo
created_at: 2008-09-10 19:33:47.822421 -06:00
filter:
  - erb
  - textile
filename:    photo-1
photo:       IMG001.jpg
description: This is the first photo
<%= Webby::YAML_SEP %> 
title:       Second Photo
filename:    photo-2
photo:       IMG002.jpg
description: This is the second photo
<%= Webby::YAML_SEP %> 
title:       Thrid Photo
filename:    photo-3
photo:       IMG003.jpg
description: This is the thrid photo
<%= Webby::YAML_SEP %>
h1. <%%= @page.title %>

!<%%= @page.photo %>!

p(desc). <%%= description %>
</pre>

The example above will result in three output files being generated. The output destination is generated by combining the @directory@ / @filename@ . @extension@  One of those must be different in each meta-data block, otherwise the resulting output files will overwrite one another. In the example, I have chose to modify the @filename@.

The first meta-data block defines the base set of meta-data for the page. Each subsequent meta-data block _modifies_ the meta-data of the first block. So, each resulting output file will be processed by the erb and textile filters (because they appear in the first meta-data block) without having to explicitly specify those filters in each block. Meta-data defined in the second block does not affect the third or subsequent blocks; only the *first* meta-data block defines inheritable parameters.

h4. Another Example

Let's say you want to generate an HTML file *and* a PDF file for a single page. This is easily done by specifying different filters.

<pre>
<%= Webby::YAML_SEP %> 
title:      Downloadable Instructions
created_at: 2008-09-10 19:33:47.822421 -06:00
filter:
  - erb
  - textile
<%= Webby::YAML_SEP %> 
extension: pdf
layout: none
filter:
  - erb
  - textile
  - htmldoc
<%= Webby::YAML_SEP %> 

content goes here ...
</pre>

In this example, the first meta-data block generates an HTML page in the standard webby fashion -- render the page and insert into the default layout. The second meta-data block adds the "htmldoc" filter<sup><a href="#fn1">1</a></sup> to the end of the filter stack. This uses the "htmldoc":http://www.htmldoc.org program to convert HTML into PDF format.

Again, we specify a different output file by changing the extension from the default to "pdf", and we prevent site navigation and headers / footers from appearing in the generated PDF by setting the layout to none. The title is inherited from the first meta-data block.

fn1(fn). This filter does not exist, but the "htmldoc":http://www.htmldoc.org program does exist. So the filter is not out of the question, and it most likely will make an appearance in a later release of webby.
