Hexo 搭建个人博客教程 - 1 - 下载安装hexo - 2018
原创    java_world    发表于:2018-06-20 17:39:18
  阅读 :314   收藏   编辑

笔者系统win7 64位

下载安装git

地址:https://git-scm.com/download/win

配置环境变量


测试是否安装成功

windows+R 输入cmd

执行

git --version
输出:
git version 2.14.1.windows.1

ps:我电脑之前安装过,版本可能比较低

下载并安装node.js

地址:https://nodejs.org/en/download/

测试是否安装成功

windows+R 输入cmd

执行

node -v
输出:
v8.11.3

下载安装hexo

在D盘,新建目录“hexo”,并进入该目录

右键->Git Bash Here , 打开git命令窗口

更新为国内镜像,国外可能比较慢

npm config set registry https://registry.npm.taobao.org

安装

npm install -g hexo-cli

等待,直到出现

+ hexo-cli@1.1.0
added 103 packages in 28.251s

初始化hexo

hexo init hexo

会将Github上的hexo项目clone下来,等待,直到出现

INFO  Start blogging with Hexo!

进入hexo目录

cd hexo/

部署文件

hexo generate

输出

INFO  Start processing
INFO  Files loaded in 298 ms
INFO  Generated: index.html
INFO  Generated: archives/index.html
INFO  Generated: fancybox/blank.gif
INFO  Generated: archives/2018/06/index.html
INFO  Generated: fancybox/jquery.fancybox.js
INFO  Generated: fancybox/jquery.fancybox.css
INFO  Generated: fancybox/fancybox_loading.gif
INFO  Generated: fancybox/fancybox_sprite.png
INFO  Generated: fancybox/jquery.fancybox.pack.js
INFO  Generated: fancybox/fancybox_loading@2x.gif
INFO  Generated: fancybox/fancybox_sprite@2x.png
INFO  Generated: archives/2018/index.html
INFO  Generated: fancybox/fancybox_overlay.png
INFO  Generated: js/script.js
INFO  Generated: fancybox/helpers/jquery.fancybox-buttons.css
INFO  Generated: css/fonts/fontawesome-webfont.eot
INFO  Generated: fancybox/helpers/jquery.fancybox-media.js
INFO  Generated: fancybox/helpers/jquery.fancybox-buttons.js
INFO  Generated: fancybox/helpers/jquery.fancybox-thumbs.css
INFO  Generated: fancybox/helpers/jquery.fancybox-thumbs.js
INFO  Generated: fancybox/helpers/fancybox_buttons.png
INFO  Generated: css/fonts/FontAwesome.otf
INFO  Generated: css/style.css
INFO  Generated: css/fonts/fontawesome-webfont.ttf
INFO  Generated: css/images/banner.jpg
INFO  Generated: css/fonts/fontawesome-webfont.woff
INFO  Generated: css/fonts/fontawesome-webfont.svg
INFO  Generated: 2018/06/20/hello-world/index.html
INFO  28 files generated in 634 ms

本地启动

hexo server

输出

INFO  Start processing
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

浏览器访问

http://localhost:4000/

1


评论
条评论

推荐阅读