diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-05-22 11:51:46 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-05-23 13:33:07 -0500 |
commit | 505b4b39b8ca7b273294e5d42d278dd1b89960ea (patch) | |
tree | 6b7ae2ab7ed5e9540fb7b87067ecb5e8fdcc0409 /docs/source | |
parent | 2f21842159d110d8633ccc6790c1fb6fa3e4b30e (diff) | |
download | mediagoblin-505b4b39b8ca7b273294e5d42d278dd1b89960ea.tar.lz mediagoblin-505b4b39b8ca7b273294e5d42d278dd1b89960ea.tar.xz mediagoblin-505b4b39b8ca7b273294e5d42d278dd1b89960ea.zip |
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!
Diffstat (limited to 'docs/source')
-rw-r--r-- | docs/source/pluginwriter/api.rst | 31 |
1 files changed, 31 insertions, 0 deletions
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 + + <img alt="A funny bunny" + src="{{ request.staticdirect('images/funnybunny.png', 'mystaticname') }}" /> |