博客搭建
博客搭建
Mingbo第一步:基本环境/工具
注意:nodejs 和 git 建议安装在C盘
nodejs官网:https://nodejs.org/zh-cn/
git官网:https://www.gitclone.com/docs/feature/github_git
vscode官网:https://code.visualstudio.com/
安装cnpm请在git bash中安装,切换国内源,安装更快
1 | cnpm install -g cnpm --registry=https://registry.npmmirror.com |
安装hexo请在git bash 安装
1 | cnpm install hexo-cli -g |
第二步:创建本地博客
- 创建一个文件夹
- Hexo框架初始化(打开git bash执行)
1 | hexo init |
第三步:安装主题
每个主题的安装方式需要大家阅读主题文档,我们这里以Butterfly
主题为例子
主题演示网站:https://butterfly.js.org/
主题使用文档:https://butterfly.js.org/posts/21cfbf15/#%E5%AE%89%E8%A3%9D
第四步:创建Github仓库
注册github后创建1个仓库
在网站配置文件添加ssh链接
1 | deploy: |
第五步:配置密钥信息
生成SSH:
1 | ssh-keygen -t rsa -C “邮箱“ |
验证信息:
1 | git config --global user.name "英文名字" |
第六步:上传博客
1 | npm install hexo-deployer-git --save |
1 | hexo g -d |
最后一步:获取网址及绑定自己的域名
| vercel: https://vercel.com/dashboard
主要作用:
- 让国内可以正常访问
- 使网址方便记忆及个性化
评论
匿名评论隐私政策
✅ 你无需删除空行,直接评论以获取最佳展示效果