reveal-hugo
reveal-hugo copied to clipboard
How can I pass a parameter to a plugin's initialization?
I'd like to use the reveal.js-menu plugin.
I started with the sample programming quotes repository.
I've copied the menu plugin repository into ./themes/reveal-hugo/static/reveal-js/plugin/menu/.
I've edited content/_index.md and added
[reveal_hugo]
plugins = ["reveal-js/plugin/menu/menu.js"]
to the front matter.
I'd like to set so of the menu plugins parameters, e.g. side, but I can't find any documentation or figure it out from first principles.
I've tried
plugins_menu_side = "right"
In the front matter, to no avail.
Is this possible?
For this you might need to write some custom JavaScript to register the plugin. You could do that in a file called end.html in the layouts/partials/reveal-hugo directory (check the docs to make sure I got that right).
There is some info about registering plugins after initialization here:
https://github.com/hakimel/reveal.js/blob/master/README.md#plugins
Reveal.registerPlugin( 'myPlugin', MyPlugin );
This might be possible in a future iteration of #133. We could add a field containing plugin initializers. But I would wait for the reveal-js upgrade before having a stab at that.