参考博客:https://blog.csdn.net/cungudafa/article/details/104295156
添加 DaoVoice 在线聊天功能
效果展示
1.官网注册账号获取appid修改conifg文件
前往 DaoVoice 官网注册并且获取 app_id
,并将 app_id
填入主题的 _config.yml
文件中。
daovoice:
enable: true
daovoice_app_id: 7e5676fe ##这里替换成你DaoVoice上的appid
2.在footer.ejs文件末尾中添加
<script>
(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/<%= theme.daovoice.daovoice_app_id%>.js","daovoice");
daovoice('init', {
app_id: "<%= theme.daovoice.daovoice_app_id%>"
});
daovoice('update');