Bug && Summary

跳过hexo渲染

在博客根目录的配置文件 _config.yml 的文件中跳过渲染。

  • 单个文件

skip_render:
   -"xxx.html"

  • 一个文件夹

skip_render:
   -"文件夹名/*"

  • 带子文件的文件夹

skip_render:
   -"文件夹名/子文件夹名/*"

hexo替换后网页出现乱码

  • 检查站点配置文件与theme文件夹内的主题名称是否一致。
  • 若一致,可能是插件缺失,手动安装swig试试。

 npm i hexo-renferer-swig
 hexo clean
 hexo  generate
 hexo server
 
  • 如果bug还没解决,暴力更新hexo。

 npm install -g npm-check
 npm install -g npm-upgrade
 npm-check
 npm-upgrade
 npm update
 hexo -v
 

镜像源

检查镜像源


npm config get registry

如果返回“ npm config set registry https: //registry.npm.taobao.org ”,则需更新


  npm config set registry https://registry.npmmirror.com
 

搭建图床

图床的作用简单来说就是把本地的图片转为图片链接,上传在自己的网页上让其他人也能看到。
可以用Chevereto + PicGo搭建图床,具体教程点此查看

github访问慢打不开

  • 长按windows键,点击R,输入cmd打开终端,输入以下代码:

 ping github.com
 

得到GitHub的IP地址 20.205.245.166

  • 打开电脑的C:\Windows\System32\drivers\etc路径,找到hosts文件,右键用 记事本 打开
  • 在最下面的空行粘贴ip地址,并加上github域名(注意ip和域名之间有空格)

 20.205.243.166 github.com
 

插入音乐播放器

  • 安装hexo-tag-aplayer插件

 npm install --save hexo-tag-aplayer
 
  • 在站点配置文件 _config.yml 中设置:

 aplayer:
  meting: true
 
  • 获取歌单、歌曲或专辑的链接。以网易云为例,用网页版打开网易云的某歌单,在链接处找到 ‘id=13584263781’ 复制。
  • 将下列代码加入需要插入音乐播放器的网页的代码中

 {% meting "13575257262" "netease" "playlist" 
 "autoplay" "mutex:false" "listmaxheight:340px" "preload:none" "theme:#ad7a86"%}
 
  • 大功告成~