What server is better for hexo _hexo how to deploy

Hexo  is a nodejs-based static blog website generator, which generates blog static files locally and uploads them directly to the server for access.

Generally speaking, building a blog site is usually very simple. The usual way is to use the WordPress program, buy a virtual host or cloud server in Silicon Cloud, and upload the installation program.

For hexo, a process is added, that is, the hexo command is executed locally and then uploaded to the server.

Static blogs have an advantage, they don't consume much CPU and memory resources.

This doesn't save you the server, but hexo makes the blog program all static files, which can save the server configuration. In most cases, you can just buy a 1 core 1G configuration. (Bandwidth is calculated separately, depending on your image resources and the number of visitors.)

This is relative to the use of PHP programs to build blog programs, which is indeed more resource-saving, but relatively speaking, hexo static blogs also have shortcomings, that is, they need to be executed locally, which is a little troublesome. For most of us, there are many steps to get started with hexo, unlike using whole-site PHP programs like WordPress.

Hexo deployment of blogs, although troublesome, but not difficult.

Introduction to Hexo


Hexo is a static blog framework based on Node.js. It has less dependency and is easy to install and use. It can easily generate static web pages and host them on GitHub, Coding, or host service providers (such as silicon cloud). The preferred framework. You can go to the official website of hexo for a detailed view, because the creator of Hexo is a Taiwanese, and the support for Chinese is very friendly, you can choose Chinese to view.

The tutorial is divided into three parts,

The first part: the basic building of hexo and deployment to the github page, and the binding of personal domain names.
Part 2: Basic configuration of hexo, changing themes, realizing multi-terminal work, and implementing domestic and foreign distribution in coding page deployment
Part 3: adding various functions of hexo, including search SEO, reading statistics, visit statistics and comments System etc.
The first part
of the basic building of hexo and deployment to the github page, as well as the binding of personal domain names.

Introduction to
Hexo Hexo is a static blog framework based on Node.js. It has less dependency and is easy to install and use. It can easily generate static web pages and host them on GitHub and Coding. It is the preferred framework for blogging. You can go to the official website of hexo for a detailed view, because the creator of Hexo is a Taiwanese, and the support for Chinese is very friendly, you can choose Chinese to view.

Hexo Construction Steps
Install Git
Install Node.js
Install Hexo
GitHub Create Personal Warehouse
Generate SSH Add to GitHub
Deploy Hexo to GitHub
Set Personal Domain Name
Post Article
1. Install Git
Git is currently the most advanced distributed version control system in the world, which can be effective , High-speed handling of project version management from very small to very large. It is a tool used to manage your hexo blog posts and upload them to GitHub. Git is very powerful, I think I recommend everyone to find out. Teacher Liao Xuefeng’s Git tutorial is very well written, so you can find out. Git tutorial

windows: Go to the official git website to download, Download git, after downloading, there will be a Git Bash command line tool, and use this tool to use git in the future.

linux: It is too simple for linux, because the earliest git is written on linux, only one line of code is required

sudo apt-get install git
1 After
installation, use git --version to check the version

2. Install nodejs
Hexo is written based on nodeJS, so you need to install nodeJs and the npm tool inside.

windows: Nodejs chooses the LTS version.

linux:

sudo apt-get install nodejs
sudo apt-get install npm
1
2
After installation, open the command line

node -v
npm -v
1
2
Check if the installation is successful

By the way, after windows is installed in git, you can directly use git bash to type the command line, without the built-in cmd, cmd is a bit difficult to use.

3. After installing
git and nodejs before installing hexo, you can install hexo. You can create a folder blog first, and then cd to this folder (or right-click git bash to open it under this folder).

input the command

npm install -g hexo-cli
1
still use hexo -v to check the version

At this point, all the installation is complete.

Next, initialize hexo

hexo init myblog
1
This myblog can have any name by itself, then

cd myblog //Enter the myblog folder
npm install
1
2 After the
new creation is completed, there are:

node_modules: dependency package
public: store the generated page
scaffolds: generate some templates
for the article source: store your article
themes: theme
** _config.yml: blog configuration file**
hexo g
hexo server
1
2
open the hexo service , And enter localhost:4000 in the browser to see your generated blog.

It looks like this:

Use ctrl+c to turn off the service.

4. GitHub creates a personal warehouse (if you think this step is cumbersome, you can directly choose to buy a virtual host or cloud server from a hosting service provider, such as silicon cloud)
First, you must have a GitHub account, and register for one.

After registering and logging in, you will see a New repository in GitHub.com,
create a new repository with the same username as yours, and add .github.io at the end. Only then will it be deployed to the GitHub page in the future. Identification, which is xxxx.github.io, where xxx is your username for registering with GitHub. I have already built it here.


Thank you everyone!

Guess you like

Origin blog.csdn.net/weixin_43205316/article/details/106973612