Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I pass a parameter to a plugin's initialization? #75

Open
hartzell opened this issue Feb 24, 2020 · 2 comments
Open

How can I pass a parameter to a plugin's initialization? #75

hartzell opened this issue Feb 24, 2020 · 2 comments

Comments

@hartzell
Copy link

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?

@joshed-io
Copy link
Owner

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 );

@davidovich
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants