搭建个人博客
搭建个人博客
-
安装
node.js
-
拥有
node.js、npm(cnpm)
-
安装
hexo
(博客框架,需要在node
环境下)cnpm install -g hexo
-
初始化博客
hexo init 文件夹名称
- 在空的文件夹下
-
运行博客
hexo s
/hexo server
-
建立新讯息
hexo new '我的新帖子'
/hexo n '我的新帖子'
-
生成静态文件
hexo generate
/hexo g
-
部署
github
仓库- 用户部署个人博客的
github
仓库的命名必须符合特定要求才行用户名 + .github.io
- 用户部署个人博客的
-
安装
git
部署插件cnpm install --save hexo-deployer-git
-
更改
_config.yml
文件-
deploy: type: git repo: https://github.com/Landuo629/Landuo629.github.io.git branch: master
-
-
一键部署
hexo deploy
/hexo d
-
更换主题
- 克隆主题
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
- 更改
_config.yml
文件theme: yilia
- 克隆主题
-
参数
本文来自博客园,作者:懒惰ing,转载请注明原文链接:https://www.cnblogs.com/landuo629/p/12691918.html