在合适的位置新建Blog文件夹,进入Blog,使用git bash here打开命令提示窗口,输入
npm install hexo-cli -g
hexo init xxx.github.io
cd xxx.github.io
npm install
hexo clean
hexo g # g = generate
hexo s # s = server
然后打开浏览器,输入地址localhost:4000,即可看到效果
hexo new test # test即新建文章的名称
此时会在source/_posts目录下生成test.md文件,输入些许内容,保存
在source/_posts/下新建一个xxx.md文件也可
hexo clean
hexo g # g = generate
hexo s # s = server
访问localhost:4000
网站的设置大部分都在**_config.yml**文件中,详细配置可以查看官方文档
git clone https://github.com/iissnan/hexo-theme-next themes/next
在网站配置文件_config.yml中,配置theme
theme: next
npm install hexo-deployer-git --save
在网站的_config.yml中配置deploy
deploy:
type: git
repo: https://sym9518:1397276116Sha@github.com/sym9518/sym9518.github.io.git
branch: master
还有一种ssh的方法,暂时不用,后续如果这种方法出现错误,再补充
repo: https://{yourname}:{yourpassword}@github.com/{yourname}/{yourname}.github.io.git
git version 2.19.1 windows.1
npm version 6.4.1
node version 8.12.0
原文:https://www.cnblogs.com/sym9518/p/11113168.html