webgen logo

webgen / static website generator

static website generation made easy!

Sub Menu

Tips

  • The basics pagecontains everything one needs to get going with webgen!
  • Descriptions for plugins can be found in the plugins section

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

General Information

Plugin name:Core/ResourceManager
Author:Thomas Leitner <t_leitner@gmx.at>
Summary:Provides access to pre- and userdefined resources
Description:The resource manager manages a list of predefined and userdefined resources. These resources can be used, for example, in page files.
Dependencies:Core/FileHandler
Parameters:

resources[]
User defined file resources. Value has to be an array of arrays with three strings defining name, resource path and output path

Description

The ResourceManager plugin provides access to the resources which are shipped with webgen, for example, the emoticons. Furthermore, it allows the user to specify their own resources.

A resource can either be included directly which means that the content of the resource is written into the HTML file. Or it can be referenced in which case only the path is written into the HTML file and the content of the resource itself is written to its predefined output path. Be aware that a resource is only written to its output path if it is referenced at least once (for example, by the plugin Tag/Resource)!

Speaking of the output path, each resource has four properties:

  • resoure name: It is unique among all resources and used to access the resource.
  • output path: This is the path relative to output directory where the resource will be written to if it is referenced at least once.
  • type: There are two different types of resources: file resources and memory resources.
    • A file resource references a file in the file system. The content of this type of resource cannot be changed during a webgen run and this type mostly used for images and other binary files.
    • A memory resource only exists during a webgen run and its content can be changed. This type of resource is used, for example, by plugins to specify addditional CSS formatting rules or Javascript code.
  • description: A short description of the resource.

Predefined Resources

A reason why webgen has a ResourceManager is the possibility to ship predefined resources with webgen. These resources can be used by any website developed with webgen. The list of predefined resources can be viewed on the Resource Reference page.