The original article is reprinted from liu Yue’s Technology blog v3u.cn/a_id_93

In a previous post, I showed you how to use Hugo to build a simple personal blog system in under three minutes, which is based on Go Lang. In fact, there is a similar static page generator on the market, Hexo pronounced /hækso/, which is based on Node.js, just like Hugo. Hexo doesn’t normally need to be deployed to our server. Our server is actually based on articles written in Hexo via Markdown, and Hexo generates static HTML pages for us and then uploads the generated HTML to our server. In short: Hexo is a static page generation, upload tool.

Before installing Hexo, make sure you have a new version of Node.js installed on your computer

npm install -g hexo-cli
Copy the code

If the installation feels slow, you can specify a domestic source for NPM

npm config set registry https://registry.npm.taobao.org
Copy the code

After the installation is complete, create the blog project

hexo init blog
Copy the code

So, create a blog folder, go to the blog directory CD Blog, create the first post

hexo new myfirst
Copy the code

Then run the Hexo service

hexo server
Copy the code

You can then access your blog site locally, using port 4000 by default

So how do you package a blog site? By running the packaging command directly, you can use the Hexo engine to parse Markdown files into browser-viewable HTML files stored in the blog/public directory

hexo generate
Copy the code

Now we can configure the hexo theme. Hexo provides the default theme Landscape, which is located under the blog -> Themes folder. Themes can be found online according to your preferences :hexo. IO /themes/

The themes are placed under the blog/ Themes folder, so let’s download a new theme

mkdir themes/next
git clonehttps://github.com/iissnan/hexo-theme-next - branch v5.1.2 themes/nextCopy the code

Then change the theme to next in the /blog/config.yml file

Finally, upload the packed public directory to the server and use the nginx proxy to access it. For details, go to v3u.cn/a_id_81

What if you don’t have your own domain name and server? That’s fine. Sign up for Github’s free static content space, sign up for an account at github.com, and create a new repository

Github. IO. The repository name must match your current github account

Now that your static content space is created, type your https:// your account.github. IO/in your browser to access it.

Push the previously packaged public files into the github repository you just created

Visit the static space url zcxey2911.github. IO

No problem. We’re done

The original article is reprinted from liu Yue’s Technology blog v3u.cn/a_id_93