-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathindex.js
More file actions
10 lines (10 loc) · 738 Bytes
/
Copy pathindex.js
File metadata and controls
10 lines (10 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
module.exports = {
hooks: {
'page:before': function(page) {
var str =
"<script>\n function attachComments() {\n const el = document.querySelector('.markdown-section');\n if (!el) return;\n const script = document.createElement('script');\n script.src = 'https://utteranc.es/client.js';\n script.setAttribute('repo', 'velopert/react-tutorial');\n script.setAttribute('issue-term', 'title');\n script.setAttribute('crossorigin', 'anonymous');\n script.setAttribute('label', 'comments');\n el.appendChild(script);\n }\n setTimeout(attachComments, 100);\n </script>";
page.content = page.content + str;
return page;
}
}
};