hexo安装
- 安装
$ npm install -g hexo
- 初始化
新建目录,git bash进入改目录,执行以下命令:
hexo init
此时会自动下载hexo文件到该目录下
hexo g #生成静态页面
hexo s #启动本地服务
此时会在hexo的文件下的public文件夹下生成html文件,即需要提交到github的文件
hexo s 开启本地预览,输入localhost:4000即可查看样式
常用命令
hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本
hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy
hexo s -g #生成并本地预览
hexo d -g #生成并上传
修改文件后,git bash进入hexo安装目录执行 hexo d -g即可