From: Christopher Allan Webber Date: Wed, 22 May 2013 16:51:46 +0000 (-0500) Subject: Document assetlink and staticdirect usage for plugins. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=505b4b39b8ca7b273294e5d42d278dd1b89960ea;p=mediagoblin.git Document assetlink and staticdirect usage for plugins. Still a bit to clean up around what the command to be run actually is, since that will likely change. This commit sponsored by David Decker. Thank you! --- diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index cd06cbc5..1cfd65d7 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -144,3 +144,34 @@ passes back a PluginStatic object. .. automodule:: mediagoblin.tools.staticdirect :members: PluginStatic + + +Running plugin assetlink +++++++++++++++++++++++++ + +.. TODO: Fix this command when it lands elsewhere ;) + +In order for your plugin assets to be properly served by MediaGoblin, +your plugin's asset directory needs to be symlinked into the directory +that plugin assets are served from. To set this up, run:: + + ./bin/gmg theme assetlink + + +Using staticdirect +++++++++++++++++++ + +Once you have this, you will want to be able to of course link to your +assets! MediaGoblin has a "staticdirect" tool; you want to use this +like so in your templates:: + + staticdirect("css/monkeys.css", "mystaticname") + +Replace "mystaticname" with the name you passed to PluginStatic. The +staticdirect method is, for convenience, attached to the request +object, so you can access this in your templates like: + +.. code-block:: html + + A funny bunny