mac -- hexo安装
简介
hexo是一个开源的博客系统,对md有很好的支持,在本地安装后,可以推送到git上开启page即可使用github的服务器资源
新设备搭建
克隆git项目
环境依赖
1
2
3
4
5
6nodejs
npm install -g hexo-cli
npm install hexo-deployer-git --save
npm install --save hexo-admin
# 字数统计
npm install hexo-wordcount --save
首次搭建
安装
依赖nodejs,这里不赘述nodejs安装方式
1 | # 安装hexo依赖 |
git部署
在git上创建一个项目fireflyso/fireflyso.github.io
修改本地配置文件_config.yml
1
2
3
4deploy:
type: git
repository: git@github.com:fireflyso/fireflyso.github.io.git #你的仓库地址
branch: master安装部署插件:
npm install hexo-deployer-git --save部署
1
2
3hexo clean #清除缓存文件 db.json 和已生成的静态文件 public
hexo g #生成网站静态文件到默认设置的 public 文件夹(hexo generate 的缩写)
hexo d #自动生成网站静态文件,并部署到设定的仓库(hexo deploy 的缩写)
定制化
安装主题,官方教程
# 使用gitee安装,github网络不稳定
git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly# 修改hexo根目录_config.yml文件 theme: butterfly # 安装渲染器(非必要) npm install hexo-renderer-pug hexo-renderer-stylus --save安装admin插件
npm install –save hexo-admin
