1:安装hexo
npm install hexo-cli -g
2:初始化一个项目
hexo init <fileName>
3:进入目录
cd fileName
4:
nmp install
5:
nmp server (localhost:4000)
执行命令过程中获取会出错,解决办法如下:
npm install hexo --no-optional
如果上诉命令不成功,则执行:
sudo npm uninstall hexo-cli -g
sudo npm install hexo-cli -g
然后问题得到解决
简单发布文章的步骤:
1,hexo init <fileDir>
2,cd fileDir
3,hexo s 启动服务
4,hexo new 'hello world' 创建文章
会在source _posts 目录下生成当前 创建的文章的md文件
5,编辑md文件
6,运行hexo g 发布文章,将会在public _posts 文件夹下
生成当前时间对应文章标题的index.html文件
7,访问:http://localhost:4000/2017/03/09/文章/index.html
网友评论