Hexo安装部署和使用

nodejs部署

安装nodejs

必须部署nodejs8.6以上版本
C:\Users\Administrator>node -v
v8.11.1
C:\Users\Administrator>npm -v
5.6.0

永久设置淘宝源:

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

git部署

傻瓜式部署就好

hexo部署

官方文档:https://hexo.io/zh-cn/docs/

npm install -g hexo-cli

先创建 E:\hexo

初始化博客目录
hexo init bigdatablog

进入bigdata目录
npm install

清理缓存
hexo clean

生成静态文件
hexo g

启动服务器
hexo s

可以整理常用命令组合
hexo clean && hexo g && hexo s

访问地址:http://localhost:4000/

hexo上传github

npm install hexo-deployer-git --save
进入bigdata目录下_config.yml文件,加上github地址
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: [email protected]:Stefanboy/Stefanboy.github.io.git
  branch: master
  
上传
hexo clean && hexo deploy  应该会出现 github的登录窗口 输入账号密码登录

地址:https://Steanboy.github.io/

换主题

https://github.com/JoeyBling/hexo-theme-yilia-plus

进入bigdatablog的themes目录
cd ./themes/
git clone --depth=1 https://github.com/JoeyBling/hexo-theme-yilia-plus.git ./yilia-plus


修改hexo根目录下的 _config.yml 
theme: yilia-plus

部署上传到github
hexo clean && hexo deploy

选择hackeruncle-hexo的主题

  • 选择hackeruncle-hexo

    https://github.com/Hackeruncle/Hackeruncle-hexo

  • clone仓库

      进入blog目录
      Administrator@G0XO2VBVTUOBVSS MINGW64 /e/blog
      $ git clone https://github.com/hackeruncle/hackeruncle-hexo.git ./hackeruncle-hexo
    
      Administrator@G0XO2VBVTUOBVSS MINGW64 /e/blog
      $ cd  hackeruncle-hexo/
    
  • github重建仓库

      https://github.com/Stefanboy/Stefanboy.github.io
      
      先delete repo:Stefanboy.github.io
      再创建   repo:Stefanboy.github.io
    
  • _config.yml修改仓库地址

      deploy:
    type: git
    repo: [email protected]:Stefanboy/Stefanboy.github.io.git
    branch: master
    
  • 本地测试+推送github

      先在本地试一下
      hexo clean && hexo generate && hexo server
      打开页面
      http://localhost:4000
    
      本地没有问题,推送部署到github
      hexo clean && hexo deploy
      打开页面
      https://Stefanboy.github.io
    

如何创建blog

Markdown语法学习

[http://markdown.xiaoshujiang.com/](http://markdown.xiaoshujiang.com/)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章