~ hexo -v
hexo-cli: 1.1.0os: Darwin 17.3.0 darwin x64
http_parser:2.7.0node:8.9.4v8:6.1.534.50uv:1.15.0zlib:1.2.11ares:1.10.1-DEV
modules:57nghttp2:1.25.0openssl:1.0.2n
icu:59.1unicode:9.0cldr:31.0.1tz:2017b
七、创建本地博文服务
然后创建一个空文件夹, 比如:hexo-blog
进入hexo-blog目录
执行hexo init初始化博客站点,如果最后一行显示Start blogging with Hexo!,代表创建成功
执行hexo server 启动博文站点
访问http://localhost:4000就能打开博文了
Ctrl+C关闭服务器
~ mkdir hexo-blog
~ cd hexo-blog
hexo-blog hexo init
INFO Cloning hexo-starter to ~/hexo-blog
Cloning into '/Users/zhengyong/hexo-blog'...
remote: Counting objects: 68, done.
remote: Total 68 (delta 0), reused 0 (delta 0), pack-reused 67
Unpacking objects: 100% (68/68), done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into '/Users/zhengyong/hexo-blog/themes/landscape'...
remote: Counting objects: 838, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 838 (delta 1), reused 3 (delta 0), pack-reused 832
Receiving objects: 100% (838/838), 2.55 MiB | 90.00 KiB/s, done.
Resolving deltas: 100% (441/441), done.
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO Install dependencies
npm WARN deprecated titlecase@1.1.2: no longer maintained
npm WARN deprecated postinstall-build@5.0.3: postinstall-build's behavior is now built into npm! You should migrate off of postinstall-build and use the new `prepare` lifecycle script with npm 5.0.0 or greater.
> fsevents@1.2.4 install /Users/zhengyong/hexo-blog/node_modules/fsevents
> node install
[fsevents] Success: "/Users/zhengyong/hexo-blog/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> nunjucks@3.1.3 postinstall /Users/zhengyong/hexo-blog/node_modules/nunjucks
> node postinstall-build.js src
npm notice created a lockfile as package-lock.json. You should commit this file.
added 464 packages in 28.659s
INFO Start blogging with Hexo!
hexo-blog hexo server
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
^CINFO Good bye
blog hexo new"Hexo部署github博客"
INFO Created: ~/Documents/GitHub/hexo-blog/source/_posts/Hexo部署github博客.md
3) 打开编辑Hexo部署github博客.md文件进行Markdown编辑
open ~/Documents/GitHub/hexo-blog/source/_posts/Hexo部署github博客.md`
4)发布文章:hexo d -g
blog hexo d -g
INFO Start processing
INFO Files loaded in922 ms
INFO Generated: index.html
INFO Generated: archives/2018/09/index.html
INFO Generated: archives/index.html
INFO Generated: 2018/09/03/hello-world/index.html
INFO Generated: archives/2018/index.html
INFO Generated: 2018/09/03/my-first-hexo-blog/index.html
INFO Generated: fonts/iconfont.8c627f.woff
INFO Generated: fonts/iconfont.45d7ee.svg
INFO Generated: fonts/iconfont.16acc2.ttf
INFO Generated: fonts/default-skin.b257fa.svg
INFO Generated: fonts/tooltip.4004ff.svg
INFO Generated: img/default-skin.png
INFO Generated: img/scrollbar_arrow.png
INFO Generated: img/preloader.gif
INFO Generated: fonts/iconfont.b322fa.eot
INFO Generated: slider.e37972.js
INFO Generated: mobile.992cbe.js
INFO Generated: main.0cf68a.js
INFO Generated: main.0cf68a.css
INFO Generated: 2018/09/04/Hexo部署github博客/index.html
INFO 20 files generated in475 ms
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files frompublic folder...
INFO Copying files from extend dirs...
warning: CRLF will be replaced by LF in fonts/tooltip.4004ff.svg.
The file will have its original line endings in your working directory.
[master d1c205f] Site updated: 2018-09-0411:11:086 files changed, 835 insertions(+)
create mode 1006442018/09/04/Hexo部署github博客/index.html
To https://github.com/zyongjava/zyongjava.github.io3f0aab7..d1c205f HEAD -> master
Branch 'master'set up to track remote branch 'master'from'https://github.com/zyongjava/zyongjava.github.io'.
INFO Deploy done: git