🍻 Do not see the tomb of five ling heroes, no flowers without wine hoe do field

preface

The reason why I choose GitHub Pages as my blog is that it is completely free, and there is no need to spend money to buy cloud services to build it. There are also many supported themes. Of course, the most important thing for us to write a blog is creation. Just write blogs that others can understand and that are fast, concise, and easy to maintain (hexo). The setup process will take a little bit of time 😋.

1 All things are difficult before they are easy 😖

The basic flow

  • Set up a Github account
  • To create aSpecial Github repository, build a simple versionMaking Pages blog(More on how special)
  • How to update blog content.
  • Understand the basic syntax and usage of Hexo
  • Implement one with the Hexo blog frameworkFast, simple and efficientThe blog

Set up a Github account

Enter github and fill in the basic information according to the steps. Github will send a verification code to your email for verification. After the verification is successful, you will have your own Github account 😕(my Github account is written before this garbage, big mouth.)

How to sign up 👆

The appearance of successful registration 👆

Build a simple GitHub Pages blog

Github is a special github repository 😇, because it corresponds to the format of the repository name is username. Github. IO (username represents your github registration name).

What the new warehouse looks like 👆

After the repository is successfully created, click Settings to go to the Settings screen and scroll down to see the GitHub Pages TAB. Below is the address of your GitHub Pages. Click and you will find that your naked blog is born 🤗. After all, our blog is for people to look at. We’d better wear clothes. Click Choose a theme and you’ll have a bunch of themes to choose from

Enter the Settings look 👆

findGitHub PagesWhat the label looks like 👆

The appearance of streaking 👆

Choose what the theme looks like 👆

The appearance of wearing clothes 👆

Note the following two questions when naming a warehouse

  • If you named the warehousexxx.github.ioIsn’t you of making user name (XXX) then you access address will become the username. Making. IO/XXX. Making. IO 🎨. It’s not that you can’tNot beautiful👀

  • So if you name your repository arbitrarily like a test, when you clickSettings“Will ask you if you want to upgrade your current project toGitHub Pages

  • So we’ll stick to the rules. Separate from other business-level projects, a blog is an independent, static website that follows the rules. 🎈

Update blog content

Note: the prerequisite is that your computer has been configured with the related configuration of git (otherwise you will not be able to use git command oh) specific how to configure 🤞 Liao Xue-feng git tutorial can be very complete

  • Now put on clothes blog content we should modify how to do 🤫(It's the same thing you do when you put an elephant in a fridge), you should first open the refrigerator door (find the project addressClone the project locally) 🍕.

Find what the project address looks like 👆

  • Step 2 Put the elephant in the refrigerator (Modify some code in the projectFor example, we welcome. Modified to welcome to my blog)🍔.

What the clone project looks like 👆

  • Step 3 Close the refrigerator door (will modify the document again afterCommit to making)🍟, then visit your address (username.github. IO) again and you will find that your changes have been updated (github Pages may be delayed after the project is updated). The time for a cup of tea is updated.) 😁

How the submitted project looks 👆

So far, your simple blog on the completion of 🧐, although said at present just a simple version of the small blog, but you want to have a beautiful resume to this can so far, their own style. This online resume is not better than the PDF resume, use your brain 😎.

2 Just try 😝

Install Hexo and learn the basic usage of Hexo

The preparatory work

  • Node.js (Node.jsThe version must be no less than10.13, recommended useNode. Js 12.0And above)
  • Git

The installationHexo

npm install hexo-cli -g // Install hexo globally. If the installation is particularly slow, use CNPM to install hexo locally: NPM install hexo
hexo init blog   // Initialize the blog
cd blog // Go to the specified directory
npm install // Install dependencies
hexo s // Run the project
Copy the code

Browser to localhost:4000 to see the initialized blog (hexo for mobile ✨)

HexoImportant configuration

title: Drinkwd's personal blog # Website title
subtitle: 'Welcome to Drinkwd's personal blog' # site subtitle
description: 'I've been on the top of mountains and I've been in valleys, and I've learned a lot from both.' # Website Description
author: drinkwd # the author
url: https://drinkwd.github.io/ # Your website url should not omit HTTP/HTTPS
theme: landscape You can change the theme (not the name, but the document steps)
deploy:
  type: git Git git git git git git git git git git git
  repository: https://github.com/drinkwd/drinkwd.github.io.git  # Warehouse address
  branch: main # remote branch
Copy the code

Subject to modify

This theme is modified alive I am to get more than 2 hours 🧭 choose phobia, really do not know which theme is more suitable for themselves, that is, to cool and simple May the force be with you (don’t be too uncool nothing with 👑) finally selected fluid Chinese document, various configuration files said particularly fine, Thanks to the author 🧎♂️, follow the step-by-step instructions to create a cool and satisfying blog. Guest officer I pictured 🙆♂️ blog address.

HexoCommon commands

View results locally

$ hexo s
Copy the code

New articles

$ hexo new <title>
Copy the code

A new page

$ hexo new page <title>
Copy the code

Push to making

$ hexo deploy
Copy the code

If you do not have the hexo-deployer-git plug-in installed when executing hexo d, install it in your working directory

$ cnpm install hexo-deployer-git --save
Copy the code

Matters needing attention

If you’re performing hexo d and you’re asked to enter your account and password every time it’s a waste of time, fill in your Github username and password. The two solutions I know of are 🍦

  • usevscodeTerminal push (good job 🎨),vscodeYou will be prompted to bindgithubAccount, so every time you log invscodeHelp verify 🤪.
  • Set up thesshI’m also learninggitWhen necessary, step at this time or to take out againBig man Liao Xuefeng’sgitThe tutorialThe 🤪.

It is a good idea to perform hexo clean before executing hexo D (to be clear about cached and static files, otherwise it is possible to update the previous version of the file) or to use hexo clean && hexo D in this way

conclusion

I had a lot of fun blogging. Although it takes some time, the process of teaching people to fish is also a process of learning more deeply. Come on 🎉. Young 🎈May the force be with you🎈

In this paper, the reference

hexo

GitHub Pages is a basic personal website

fluid