Skip to content

Commit a257d96

Browse files
committed
Merge pull request #2 from jpreynat/master
Adapt plugin to GitBook 3
2 parents 0495009 + e316ee8 commit a257d96

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

_layouts/website/page.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends template.self %}
2+
3+
{% block head %}
4+
{{ super() }}
5+
<script>
6+
window["gitbook-plugin-github-buttons"] = {{ config.pluginsConfig['github-buttons']|dump|safe }};
7+
</script>
8+
{% endblock %}

index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@ module.exports = {
33
assets: './lib',
44
js: [
55
'plugin.js'
6-
],
7-
html: {
8-
"head:end": function () {
9-
// window["gitbook-plugin-github-buttons"]
10-
var configs = JSON.stringify(this.options.pluginsConfig["github-buttons"]);
11-
return '<script>' +
12-
'window["gitbook-plugin-github-buttons"] = ' + configs + ';'
13-
+ '</script>';
14-
}
15-
}
6+
]
167
}
178

189
};

0 commit comments

Comments
 (0)