Fork me on GitHub

重回博客

重新搭建博客

将你原来电脑上已经配置好并生成的hexo目录拷到你的新电脑上,注意无需拷全部,只拷如下几个目录

1
2
3
4
5
_config.yml
package.json
scaffolds/
source/
themes/

将这些目录放到一个目录下,如:hexo/

在你的新电脑上首先配置hexo环境

node.js安装

  • 下载链接:https://nodejs.org/en/

    LTS:长期稳定版 Current:当前最新版

    hexo安装

  • 安装hexo,执行命令:

    npm install -g hexo

安装好之后,进入hexo/目录

模块安装,依次执行命令:

npm install

npm install hexo-deployer-git –save

npm install hexo-generator-feed –save

npm install hexo-generator-sitemap –save

部署,依次执行命令

hexo g

hexo deploy

其他须知

hexo s

  • 命令可以进行本地的快速部署,进行快速预览

hexo s -p 5000

  • hexo默认的端口是4000。有时会有其他进程占用4000端口的情况,导致无法访问。如出现这种情况,可采用以上的命令更改本地快速预览的端口。
0%