From d112d62a3f93a001bba21153c4414346d1c78369 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 2 May 2014 02:03:01 -0400 Subject: [PATCH] updated plugin docs --- docs/plugins/create.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/plugins/create.rst b/docs/plugins/create.rst index 7ecc627d0a..6cf3fdfaff 100644 --- a/docs/plugins/create.rst +++ b/docs/plugins/create.rst @@ -31,7 +31,9 @@ Each plugin package contains a configuration file called ``plugin.json``. Here i "description": "Your plugin's description", "url": "Absolute URL to your plugin or a Github repository", "library": "./my-plugin.js", - "staticDir": "/assets", + "staticDirs": { + "images": "public/images" + }, "less": [ "assets/style.less" ], @@ -45,7 +47,9 @@ The ``id`` property is a unique name that identifies the plugin. The ``library`` property is a relative path to the library in your package. It is automatically loaded by NodeBB (if the plugin is activated). -The ``staticDir`` property is a path (relative to your plugin's root) to a directory that NodeBB will expose to the public at the route ``/plugins/{YOUR-PLUGIN-ID}``. +The ``staticDirs`` property is an object hash that maps out paths (relative to your plugin's root) to a directory that NodeBB will expose to the public at the route ``/plugins/{YOUR-PLUGIN-ID}``. + +* e.g. The ``staticDirs`` hash in the sample configuration maps ``/plugins/my-plugin/images`` to ``/path/to/your/plugin/public/images`` The ``less`` property contains an array of paths (relative to your plugin's directory), that will be precompiled into the CSS served by NodeBB.