Preparations:

  • Sign up for GitHub [github.com/]
  • Install Node. js and NPM, and understand the basic knowledge
  • Install Git and learn the basics

Create a blog repository on GitHub

1. Open GitHub, click the plus sign in the upper right corner, and select New Repository to create a New repository.IO, for example, mykepler.github. IO. Then click Create Repository and you’ll have a Github Repository for your blog.

2. Configure SSH Keys

1. Generate SSH Keys

SSH -keygen -t rsa -c "Github registered email address"Copy the code

And then all the way back to the car. If you are a Windows user, you will find id_rsa and id_rsa.pub in your C:\Users\admin. SSH file. If you are a Mac user, run pbcopy < ~/. SSH /id_rsa.pub to copy SSH Keys.

2. Configure SSH Keys

Go to the Settings page and select SSH and GPG keys.Click the New SSH Key button to go to the following page and enter the title (name it optionally) and SSH Keys 👇

Install and configure Hexo

Liverpoolfc.tv: hexo. IO/useful – cn /

1. Create a new folder for your blog.

2. Open the terminal, go to the directory in this folder, and start installing Hexo.

npm install -g hexo-cli
Copy the code

Once Hexo is installed, type:

hexo
Copy the code

If the image below appears, your Hexo installation is successful.

4. Initialize the blog

// Create a blog folder and initialize the blog, <folder> is the folder name hexo init <folder> // Enter the blog folder, <folder> is the folder name CD <folder> // node.js command, Install NPM install according to the dependencies configuration of the blogCopy the code

After installation, your folder should look like 👇

Here _config.yml is your site configuration file, which you can open to modify your site information (each: followed by a space) in the repo to fill in your warehouse address.

Url: http://yoursite.com take this change to your lot address (for example: http://myKepler.github.io) deploy: type: git repo: [email protected]:myKepler/myKepler.github.io.git branch: masterCopy the code

Fifth, the first article

1. Create a new article

Hexo New "Article title"Copy the code

The new markdown file will be in source/_posts, and the article will be written in this markdown file. Article title, article editing time, labels, categories and other information can be manually modified.

Tags and categories in the blog are automatically generated and updated according to your name.

2. Local preview of articles

NPM install hexo-server --save Hexo sCopy the code

Type http://localhost:4000 into your browser and you’ll see your own blog.

Six, blog release

npm install hexo-deployer-git --save
hexo g
hexo deploy
Copy the code

Once successfully published, you can see the compiled file of your blog on GitHub. Blog address: xxxxxxx.github. IO 🌟

7. Theme modification

The default theme landscape is ugly 👇

You can choose your favorite theme in the theme module of the official website.

Recommended Topics:

  • hexo-theme-jekyll
  • hexo-theme-yilia
  • hexo-theme-next
/ / themes download git clone https://github.com/litten/hexo-theme-yilia.git themes/yiliaCopy the code

Change theme: landscape from _config.yml to theme: yilia, and then re-execute hexo g to change the theme

If something goes wrong, you can perform Hexo Clean to clean up the public content and then regenerate and publish it.

Bind domain name

If you don’t want to use xxxxxxx.github. IO as your blog address, you can use a domain name binding option.

Create a new CNAME file in the source folder of the blog site.

Just write one line to the CNAME file. For example, if the domain name is xxxx.com, open the file and write the following, then save.

xxxx.com
Copy the code

2. Apply for a domain name

  • Buy a domain name on Tencent Cloud/Ali Cloud
  • Real-name authentication
  • Add domain name resolution records

The host records Record type The line type Record the value MX priority TTL (in seconds) Last operating time
@ CNAME The default xxxxxxx.github.io 3600

3, wait patiently for the parsing to take effect ✌️