博客搭建:使用 Hexo(框架)、Butterfly 主题(由安知鱼维护)和 Vercel(托管)搭建个人博客的完整流程如下:
一、准备工作
安装依赖:
安装 Node.js (LTS 版本)
安装 Git
安装 Hexo 命令行工具:
1npm install -g hexo-cli
注册账号:
GitHub 账号(存放代码)
Vercel 账号(托管网站,支持 GitHub 登录)
二、本地搭建 Hexo 博客1.初始化项目:
123hexo init blog # 创建项目cd blog # 进入目录npm install # 安装依赖
2.安装 安知鱼 主题:
1git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
3.启用主题:修改 _config.yml(站点配置文件):
1theme: anzhiyu
4.安装 pug 和 stylus 渲染插件
1npm install hexo-renderer- ...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment