webgen logo

webgen / static website generator

static website generation made easy!

Latest news

2007-09-08: Small bug fix release. More...

2007-06-29: Some bug fixes and one small feature enhancement. More...

2007-05-20: Fixed bug which prevented installation via Rubygems. More...

Links

Generated by webgen

Page Menu

General Information

Plugin name:File/CopyHandler (File/DefaultHandler)
Author:Thomas Leitner <t_leitner@gmx.at>
Summary:Copies files from source to destination
Parameters:

erbPaths["**/*.rhtml", "**/*.rcss"]
The path patterns which match the files that should get preprocessed by ERB. The leading letter r is removed from the extension.

paths["**/*.css", "**/*.js", "**/*.jpg", "**/*.png", "**/*.gif"]
The path patterns which match the files that should get copied by this handler.

Description

This plugin has two operation modes:

  • All files that match the erbPaths parameter are processed with ERB and then written out. The leading letter r is stripped from the extension (e.g. .rhtml) to form the output file name. During processing with ERB the current node object is available. This operation mode is useful, for example, for .rhtml files (HTML with embedded ruby) or .rcss files (CSS files with embedded ruby).
  • All files that match the paths parameter are copied from the source to the output directory without modification. This is useful, for example, for CSS stylesheets, javascript files and images.

When a file matches against both parameters, it is handled as if it matches only against erbPaths.

Also note that files are written only if the source file is newer than the output file! This means that, for example, images are copied only during the first webgen run and not during the second if the image files have not changed.