# hexo 博客安装
安装 nodejs
安装 git
安装 hexo(windows 需进入 git bash)
npm install -g hexo-cli初始化博客目录
hexo init blog进入博客目录
cd blog初始化 hexo 到博客目录
npm install
# shoka 主题安装
下载主题
git clonehttps://github.com/amehime/hexo-theme-shoka.git./themes/shoka卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器
npm un hexo-renderer-marked --save安装(md 文件渲染器,压缩 css/js/html)
npm i hexo-renderer-multi-markdown-it --save安装(给生成的 css 文件们添加浏览器前缀)
npm i hexo-autoprefixer --save安装(站内搜索功能)
npm i hexo-algoliasearch --save安装(文章或站点字数及阅读时间统计)
npm i hexo-symbols-count-time --save安装(生成 Feed 文件)
npm i hexo-feed --save
# Hexo 部分常用命令
清除静态文件
hexo clean生成静态文件
hexo g安装 git 推送插件
npm install hexo-deployer-git --save推送静态文件到 git
hexo d
# 安装 hexo-admin(编写博客插件)
npm install hexo-admin --savehexo-admin 编辑 url
settings 设置用户名、密码、Secret
把底部生成的配置拷入 hexo 配合文件中 (_config.yml)
admin:  | |
username: username  | |
password_hash: xxxxxx  | |
secret: 'my super secret phrase' #用单引号包裹  | |
deployCommand: 'hexo_publish.sh' #windows 用 hexo_publish.bat,linux 用 hexo_publish.sh  | 
# hexo_publish.sh
#!/bin/bash | |
hexo clean  | |
hexo g  | |
hexo d  | 
# hexo_publish.bat
@echo off  | |
cd D:\blog  | |
d:  | |
@cmd /c "hexo clean&& hexo g&&hexo d&&echo success" |