搭建个人博客


  1. 安装node.js

image-20210430101612677

  1. 检验是否安装成功
node -v

npm -v

image-20210430102137966

  1. 更换淘宝镜像源
npm install -g cnpm --registry=https://registry.npm.taobao.org

image-20210430102236390

  1. 检查是否更换成功
cnpm -v

image-20210430102342035

  1. 安装hexo框架
cnpm install -g hexo-cli

image-20210430102434333

  1. 检查是否安装成功
hexo -v

image-20210430102521607

  1. 建立一个空的文件夹
mkdir blog 
  1. 进入blog
cd blog/
  1. 初始化hexo,搭建博客
sudo hexo init

image-20210430103411000

  1. 启动博客
hexo s

image-20210430103517852

发现在本地的localhost:4000端口启动

image-20210430103853158

  1. 新建第一篇博客文章
hexo new "我的第一篇博客文章"

image-20210430103815888

  1. 根据路径查看是否存在
/Users/liuguangquan/blog/source/_posts/

image-20210430104038263

  1. 利用vim打开添加内容

image-20210430104412905

  1. 清理,生成
hexo clean

hexo g

image-20210430104644951

  1. 把博客推送到github上

登陆账号,新建仓库

注意:仓库名必须与用户名一致

image-20210430105250251

image-20210430105827053

  1. 安装git插件
cnpm install --save hexo-deployer-git

image-20210430105452842

  1. 设置_config.yml
  • 进入底部有个deploy

image-20210430105645142

  • 修改type
type: git
  • 添加repo
repo: https://github.com/echo-machile/echo-machile.github.io.git
  • 添加branch
branch: master

image-20210430110110262

  1. 将博客部署到远端
hexo d
  1. 访问博客

image-20210430114241934

  1. 修改博客样式
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
  • 编辑_config.yml文件

image-20210430115317612

  • 找到theme修改为yilia,保存退出

  • 清理,生成,开启

hexo clean

hexo g

hexo s

image-20210430115548362

  1. 推送到远端
hexo d

matery主题优化链接


文章作者: 尘落
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 尘落 !
评论
  目录