正在搬运下一页::>_<:: . . .

HEXO之live2d插件


HEXO之live2d插件

1.参考链接

官方:https://www.npmjs.com/package/hexo-helper-live2d

参考:https://www.jianshu.com/p/3a6342e16e57

2.安装插件

首先检查博客主目录下面的 package.json里是否有"hexo-helper-live2d": "^3.0.3",依赖,有的话可以先卸载,使用命令:

npm uninstall hexo-helper-live2d

之后再安装:

npm install --save hexo-helper-live2d

3.挑选模型

模型下载

解压后packages里每个文件夹是一个模型,挑选需要的复制到hexo根目录下/node_modules中。

模型预览

4.更改配置

hexo根目录的_config.yml中配置live2d。

live2d:
  enable: true
  scriptFrom: local
  pluginRootPath: live2dw/
  pluginJsPath: lib/
  pluginModelPath: assets/
  tagMode: false
  debug: false
  model:
    use: live2d-widget-model-tororo #改为自己需要的
  display:
    position: right
    width: 150
    height: 300
  mobile:
    show: true #移动端是否开启
  react:
    opacity: 0.7

5.live2d与不蒜子冲突的解决

不解决将导致显示问题和hexo clean后live2d模型丢失问题!!

参考:https://github.com/blinkfox/hexo-theme-matery/issues/458

不蒜子js文件目录:

hexo\themes\hexo-theme-matery-master\source\libs\others\busuanzi.pure.mini.js

大佬提供的代码:

var bszCaller,bszTag;!function(){var c,d,e,a=!1,b=[];ready=function(c){return a||"interactive"===document.readyState||"complete"===document.readyState?c.call(document):b.push(function(){return c.call(this)}),this},d=function(){for(var a=0,c=b.length;c>a;a++)b[a].apply(document);b=[]},e=function(){a||(a=!0,d.call(window),document.removeEventListener?document.removeEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.detachEvent("onreadystatechange",e),window==window.top&&(clearInterval(c),c=null)))},document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){/loaded|complete/.test(document.readyState)&&e()}),window==window.top&&(c=setInterval(function(){try{a||document.documentElement.doScroll("left")}catch(b){return}e()},5)))}(),bszCaller={fetch:function(a,b){var c="BusuanziCallback_"+Math.floor(1099511627776*Math.random());window[c]=this.evalCall(b),a=a.replace("=BusuanziCallback","="+c),scriptTag=document.createElement("SCRIPT"),scriptTag.type="text/javascript",scriptTag.defer=!0,scriptTag.src=a,document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)},evalCall:function(a){return function(b){ready(function(){try{a(b),scriptTag.parentElement.removeChild(scriptTag)}catch(c){bszTag.hides()}})}}},bszCaller.fetch("//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback",function(a){bszTag.texts(a),bszTag.shows()}),bszTag={bszs:["site_pv","page_pv","site_uv"],texts:function(a){this.bszs.map(function(b){var c=document.getElementById("busuanzi_value_"+b);c&&(c.innerHTML=a[b])})},hides:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="")})},shows:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="inline")})}};

畅所欲言
 上一篇
matery下代码高亮插件解决方案 matery下代码高亮插件解决方案
matery下代码高亮插件解决方案 我的prism_plugin插件装了有bug不显示,故使用prismjs方案。 1.首先检查冲突如果装了prism_plugin插件请卸载: npm uninstall -S hexo-prism-pl
2020-11-21
下一篇 
英灵殿:从入门到熔化 英灵殿:从入门到熔化
私人定制英灵殿攻略1.资源准备uplay又又又初始化登不上了 -> 连手机热点 -> 登录成功 -> 开始下载 -> ??? -> 加速器启动 -> 下载完成! 2.错误用法 好家伙,卡住了,强行让我欣赏
  目录