Class Webby::Builder
In: lib/webby/builder.rb
Parent: Object

The Builder class performs the work of scanning the content folder, creating Resource objects, and converting / copying the contents to the output folder as needed.

Methods

create   load_files   new   new_page_info   run   run  

Public Class methods

This mehod is used to create a new page in the content folder based on the specified template. page is the relative path to the new page from the content/ folder. The template is the name of the template to use from the templates/ folder.

Creates a new Builder object for creating pages from the content and layout directories.

Create a new instance of the Builder class and invoke the run method. If the :rebuild option is given as true, then all pages will be recreated / copied.

Public Instance methods

Runs the Webby builder by loading in the layout files from the layouts/ folder and the content from the contents/ folder. Content is analyzed, and those that need to be copied or compiled (filtered using ERB, Texttile, Markdown, etc.) are handled. The results are placed in the output/ folder.

If the :rebuild flag is set to true, then all content is copied and/or compiled to the output folder.

A content file can mark itself as dirty by setting the dirty flag to true in the meta-data of the file. This will cause the contenet to always be compiled when the builder is run. Conversely, setting the dirty flag to false will cause the content to never be compiled or copied to the output folder.

A content file needs to be built if the age of the file is less then the age of the output product — i.e. the content file has been modified more recently than the output file.

[Validate]