hexo部署教程,并安装Arknight主题

First Post:
Last Update:

基本安装

安装hexo命令行包

1
npm install -g hexo-cli

初始化hexo(会顺便生成hexo目录)

1
hexo init hexo
  • 切换目录
  • 安装npm
  • 安装上传到git的插件
1
2
3
4
5
6
7
8
cd hexo
npm install
npm install hexo-deployer-git --save
# ssh密钥生成
ssh-keygen
ssh -T git@github.com
git config --global user.name "username"
git config --global user.email "user@example.com"

修改 _config.yml文件末尾的 Deployment 部分

1
2
3
4
deploy:
type: git
repository: git@github.com:用户名/用户名.github.io.git
branch: master
  • 生成文档helloworld
  • hexo生成文件
  • hexo部署推送
  • hexo清除换成
1
2
3
hexo new helloworld
hexo g
hexo d

主题安装

安装Arknights主题(部分步骤重复)

  • 进入hexo目录
  • npm安装
  • git clone目录
  • 安装依赖
1
2
3
4
5
cd hexo
npm install
git clone https://github.com/Yue-plus/hexo-theme-arknights.git themes/arknights
npm install hexo-server hexo-browsersync hexo-renderer-pug --save
npm install hexo-renderer-stylus #最新版需要的stylus
  • 参照 Hexo 官网 修改 Hexo/ 目录下的 _config.yml

    • theme: 的值改为 arknights

    • 开启代码高亮:

      1
      2
      highlight:
      hljs: true
  • 复制 Hexo/themes/arknights/_config.yml 到 Hexo 目录下,并重命名为 _config.arknights.yml

图片插入(不完全)

添加必要插件:

1
2
3
npm install hexo-asset-image --save #安装图片插件
npm uninstall hexo-renderer-marker --save #卸载 marked
npm install hexo-renderer-markdown-it --save #安装markdown-it渲染器