I’m using Hexo as my blogging platform (static content generator). Every time I upgrade it I run into some kind of issue. Usually because:
- I upgrade rarely and I have made some changes into themes etc.
- I don’t remember how to upgrade hexo and plugins to the latest version with NPM. It seems that one command doesn’t work. Some parts upgrade and some don’t.
- I forget to delete some temporary files and first time running
hexo generateproduces invalid results
I decided to document the steps so that I don’t have to google them every time. These steps assume you are using Git to keep your blog content and you are deploying the generated content. If not just ignore everything that talks about branches.
source branch is where the source of the blog is (markdown files etc.) and
master is for generated content. Make sure you are in the
Before upgrading remove all the files/folders that will be recreated either during
npm install or when generating content.
package.json should only contain the following:
You should run this in the folder where hexo is installed.
Install the plugins you use.
Generate the content
Start the server
After these steps you should have the latest version of hexo and plugins running.