Configure Basic Environment#
To configure the basic environment, you need to follow these steps:
- Install
git
and generate a key, saving it to your GitHub account. - Download and install
Node.js
(withnpm
installed automatically). - Use
npm
to installhexo
, with the commandnpm install -g hexo-cli
.
❗️ Note: After installing hexo
, do not run hexo init
.
Migrate Related Files#
The files that need to be migrated are:
- Blog configuration file
./_config.yml
- Theme configuration folder
./theme/
- Folder containing articles and related content
./source/
- Template folder
./scaffolds/
- File recording all plugins for the blog
./package.json
Redeploy on New Computer#
Do you remember the ./package.json
you copied in the previous step? Just run the following command in the same directory:
npm install
This will automatically read the list of plugins recorded in the package.json
file and install them one by one, so all the plugins you installed on the old device will be set up on the new device as well.
Everything else proceeds as usual: modify articles, generate static files, and deploy to git.
hexo g
hexo d