Skip to content

Commit ddac906

Browse files
Fix configuration injection
I was having an issue on [gitbook.com](https://www.gitbook.com/) regarding plugin configuration injection; finally solved it by adding this event listener. Please check it and use this patch if it works for you.
1 parent c6bb8e9 commit ddac906

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plugin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ require(['gitbook'], function (gitbook) {
6464
return window["gitbook-plugin-github-buttons"];
6565
}
6666

67+
// make sure configuration gets injected
68+
gitbook.events.bind('start', function (e, config) {
69+
window["gitbook-plugin-github-buttons"] = config["github-buttons"];
70+
});
71+
6772
gitbook.events.bind('page.change', function () {
6873
init(getPluginConfig());
6974
});

0 commit comments

Comments
 (0)