Skip to content

Commit

Permalink
add kapa.ai widget
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoventurini committed Jun 10, 2024
1 parent bc7febd commit 1c7a427
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"predeploy": "npm run build",
"deploy": "hexo-s3-deploy",
"start": "npm run build && chexo @meteorjs/meteor-hexo-config -- server"
},
"volta": {
"node": "14.21.3"
}
}
18 changes: 18 additions & 0 deletions docs/scripts/kapa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
hexo.extend.filter.register('after_render:html', function(html) {
const scriptTag = `
<script async
src="https://widget.kapa.ai/kapa-widget.bundle.js"
data-website-id="64051b0e-d79f-4fe7-b3ca-ff5c84075693"
data-project-name="Meteor"
data-project-color="#101926"
data-project-logo="https://avatars.githubusercontent.com/u/789528?s=200&v=4”
data-modal-disclaimer=“This is a custom LLM for answering questions about Meteor. Answers are based on the contents of the docs, answered forum posts, YouTube videos and GitHub issues. Please note that answers are generated by AI and may not be fully accurate, so please use your best judgement."
></script>
`.trim();

if (html.indexOf('</body>') !== -1) {
return html.replace('</body>', scriptTag + '</body>');
}

return html;
});

0 comments on commit 1c7a427

Please sign in to comment.