How does Hexo build a blog?

Download the basic template from the official website

The installation

It only takes a few minutes to install Hexo. If you encounter problems during the installation or cannot find a solution, please submit a problem and we will try to solve your problem.

Install the prerequisite

Installing Hexo is fairly simple, just install the following applications first:

Node.js (node.js version must be at least 8.10, and Node.js 10.0 or later is recommended) Git You can go directly to the Install Hexo step.

If you do not have the required program installed on your computer, follow the installation instructions below to complete the installation.

Install Git
Windows: Download and install Git. Mac: Use Homebrew, MacPorts or download the installer. Linux (Ubuntu, Debian) : sudo apt-get install git-core Linux (Fedora, Red Hat, CentOS) : sudo yum install git-coreCopy the code

For Mac users who may encounter problems during compilation, please go to the App Store and install Xcode. After Xcode is completed, Start and enter Preferences -> Download -> Command Line Tools -> Install to Install the Command Line tool.

Windows users

For users in mainland China, you can download the Git installation package from the Git for Windows image on Taobao.

Installation Node. Js

Node.js provides an official installer for most platforms. For users in mainland China, you can go to Taobao Node.js image download.

Other installation methods:

Windows: Install via NVS (recommended) or NVM. Mac: Use Homebrew or MacPorts to install. Linux (DEB/ rpm-based) : Install from NodeSource. Others: Use the appropriate package manager for installation. For Mac and Linux, it is recommended to use NVS or NVM by referring to the guidance provided by Node.js to avoid permission issues that may occur.

Windows users

When using the official Node.js installer, be sure to check the Add to PATH option (it is already checked by default).

For Mac/Linux users

If you get an EACCES permission error while trying to install Hexo, follow the instructions published by NPMJS to fix the problem. It is strongly recommended not to overwrite permissions using root, sudo, etc

Install Hexo

Once all the required applications are installed, you can install Hexo using NPM.

$NPM install -g hexo- CLI For advanced users familiar with NPM, the hexo package can be partially installed.

$NPM install hexo Once installed, you can perform hexo in either of the following ways:

npx hexo

Add node_modules from Hexo’s directory to the environment variable to use Hexo directly:

echo ‘PATH=”$PATH:./node_modules/.bin”‘ >> ~/.profile

Download your own theme from the official website and replace it locally

Then replace the download theme locally

Three, how to customize the page

hexo new page aways
Copy the code

The corresponding aways directory is then created under the sourcem directory

Add the corresponding menu from the menu menu of the theme configuration file _config.ymlSo the custom menu is added!