-
Notifications
You must be signed in to change notification settings - Fork 333
2.0 plugin migration
There are a few changes to the plugin API in Wintersmith 2.0. You will need to update your plugins to make them compatible.
There are tree major changes:
-
ContentPlugin.fromFile
method is now called with afilepath
object instead offilename
andbase
. The object contains both the relative (to the contents directory) path and the full path to the file on the filesystem.filepath.relative
andfilepath.full
respectively. -
Plugin modules are now called with an Environment instance, it is compatible with the old API but you should be aware.
-
The ContentPlugin's
render
instance method is now succeeded by theview
property, subclasees should implement thegetView
method which can return a function (same interface as the old render method) or a string referencing a global view.
Wintersmith now has a simple plugin manager, if you want your plugin to show up in the listing you have to publish it on npm and add the wintersmith-plugin
keyword to your package.json.
Check the plugin template repo for an example of a 2.0 plugin: https://github.com/jnordberg/wintersmith-plugin