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 .
一、 快速开始 创建一篇新的文章 1 $ hexo new "My New Post"
More info: Writing
启动本地服务器
More info: Server
生成静态文件
More info: Generating
部署到远程站点
More info: Deployment
本地测试
部署发布文章 1 $ hexo clean && hexo g && hexo d
二、 迁移整个hexo 1. 准备Hexo所需要的前置环境 首先确保有如下环境
Node.js (Node.js 版本需不低于 10.13,建议使用 Node.js 12.0 及以上版本)
Git
2. 在新电脑上安装Hexo 安装Hexo
1 $ npm install -g hexo-cli
安装Hexo的相关模块
1 2 3 4 5 6 $ npm install $ npm install hexo-deployer-git --save // 文章部署到 git 的模块 $ (下面为选择安装) $ npm install hexo-generator-feed --save // 建立 RSS 订阅 $ npm install hexo-generator-sitemap --save // 建立站点地图
3. 备份源文件 首先将原来电脑上的博客下面的这些文件拷贝到新的电脑上面
1 2 3 4 5 6 _config.yml package.json scaffolds/ source/ themes/
4. 测试本地能否正常运行
5. github添加 SSH Keys 首先在本地创建 SSH Keys
:
1 $ ssh-keygen -t rsa -C "957742501@qq.com"
复制生成成功的 id_rsa.pub
里面的内容, 然后粘贴到github上面
用如下指令测试是否添加成功
6. 部署发布文章 1 $ hexo clean && hexo g && hexo d