Hexo博客零基础搭建


title: 我的Hexo博客搭建
date: 2019-08-02 10:20:48

准备工作

安装Node.Js 下载地址
安装Git 下载地址

搭建博客

本地搭建

  • node版本查看

    node -v

  • npm包管理器安装

    npm install -g cnpm --registry=http://registry.npm.taobao.org

  • Hexo框架安装

    cnpm install -g hexo-cli

  • Hexo版本查看

    hexo -v

  • 建立文件包 blog

    mkdir blog

  • 进入blog目录,初始化blog

    cd blog
    hexo init

  • 启动博客

    hexo s
    http://localhost:4000

  • 进入_posts目录,新建博客

    cd source/_posts
    hexo n “我的Hexo博客搭建”
    开始编辑。。。

  • 退回blog目录,生成博客

    cd …/…
    hexo clean
    hexo g

  • 重新启动博客

    hexo s
    http://localhost:4000

部署到Github

  • 登录Github,新建仓库

    仓库名:wrandzxt.github.io

  • 安装git部署插件

    cnpm install --save hexo-deployer-git

  • 配置_config.yml文件

    在#Deployment中加入

    type: git
    repo: https://github.com/wrandzxt/wrandzxt.github.io
    branch: master
    保存退出

  • 部署到远端

    hexo d

    如果出现错误
    fatal: unable to auto-detect email address (got ‘ÍõÈó@LAPTOP-HKCE608G.(none)’)
    FATAL Something’s wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
    完成
    git config --global user.email “you@example.com”
    git config --global user.name “Your Name”

  • 登录github,访问wrandzxt.github.io

后续

更换主题

  • 推荐主题 链接
  • 下载主题

    git clone http://github.com/litten/hexo-theme-yilia.git themes/yilia

  • 更改主题

    进入_config.yml文件
    /# Extensions
    theme: yilia

  • 重新打开blog

    hexo clean
    hexo g
    hexo s

  • 推到github

    hexo d

ps:这是第一次写博客,希望大家多多关注,共同交流进步,笔芯~

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值