Skip to content

Commit

Permalink
Merge pull request #293 from hyphacoop/add-analytics
Browse files Browse the repository at this point in the history
Add analytics to Handbook
  • Loading branch information
tripledoublev authored Apr 25, 2024
2 parents 1f789ea + dfbd640 commit bfba196
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion book.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"readme": "handbook.md"
},
"plugins": [
"anchors"
"anchors",
"add-custom-js"
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Hypha handbook describes the vision, processes, and culture of Hypha Worker Co-operative. 🌿🍄",
"devDependencies": {
"gitbook-plugin-anchors": "^0.7.1",
"honkit": "^4.0.8"
"honkit": "^4.0.8",
"add-custom-js": "file:plugins/add-custom-js"
},
"repository": {
"type": "git",
Expand Down
5 changes: 5 additions & 0 deletions plugins/add-custom-js/assets/add-custom-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var script = document.createElement('script');
script.src = 'https://analytics.hypha.coop/js/script.js';
script.defer = true;
script.setAttribute('data-domain', 'handbook.hypha.coop');
document.head.appendChild(script);
9 changes: 9 additions & 0 deletions plugins/add-custom-js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
website: {
assets: "./assets",
js: [
"add-custom-js.js"
]
}
};

8 changes: 8 additions & 0 deletions plugins/add-custom-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "add-custom-js",
"version": "1.0.0",
"engines": {
"honkit": "^4.0.8"
}
}

0 comments on commit bfba196

Please sign in to comment.