安装 hexo-server
npm install hexo-server --save
启动服务
hexo server #默认端口为4000
hexo server -p 5000 #指定端口为5000
hexo server -i 192.168.1.1 #指定地址
创建文章
hexo new [layout] <title>
新建的文章默认会被保存在source/_posts文件夹。
其中,layout默认为post,若指定,会在scaffolds文件夹找对应的布局文件。
- 常用命令
hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #将.deploy目录部署到GitHub
- 常用复合命令
hexo d -g #生成加部署
hexo s -g #预览加部署
hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy
网友评论