Creating a Plugin

Much of the built in functionality in Sitegen is implemented by plugins. You can create your own plugins to add custom functionality to the various steps of building the site. A plugin is implemented as a MoonScript class. Functionality is injected into the build by implemending certain properties or methods. The Plugin Lifecycle describes what happens to a plugin when Sitegen builds the site.

Plugin Lifecycle

Terminology

site scope: the object that represents the function environment that is used when running the initialize function. The mixin_funcs property on a plugin is used to extend this scope.

template scope: the object that holds all the fields available to any template rendered for that page. The tpl_helpers property on a plugin is used to extend this scope.