This is the second day of my participation in the November Gwen Challenge. Check out the details: the last Gwen Challenge 2021
preface
Has been following bosses footsteps as a rookie, always wanted to have a belong to his own blog, but there has been no action (mostly not), but casual day to see a number of public article title something like this “take you ten minutes to build a blog” well this is a title aroused the desire of the blog in my heart, I started to follow the steps and I started to step on the pit road.
First, preparation
Create a public repository with username.github. IO
1. Download Node and configure environment variables. (My first pitfall is that Node does not have environment variables configured.
2. Download Git and configure environment variables (see Liao Xuefeng’s tutorial if you don’t know)
Ii. Construction process
Configure information for Git
Window +r Open CMD open terminal configure git information enter the following information:
Git config -g user.name git config -g user.nameCopy the code
Git config -g user.emilCopy the code
Generate the key
Enter the following command on the terminal:
Ssh-keygen -t rda -cCopy the code
After that, regardless of the content, three enter can be
Copy the key and paste it into Github
The key above will be generated into the user folder in drive C. If you can’t find it, search id_rsa.hub in drive C, then open it and copy all the contents inside. Log in to your Github and click your profile picture in the upper right corner, a drop-down menu will appear to find Setting. Select SSH and GPG Keys, click New SSH Key, then just paste the key you copied on it, name it whatever you want.
To test whether your key is configured successfully, enter the following command:
ssh -T [email protected]
Copy the code
Select yes if you see… successfull.. That’s a success
Hexo installation
Hexo is an integrated blogging framework that quickly generates static web pages based on topics
**git Bach here** Install hexo and execute the following statement:
npm i -g hexo-cil
Copy the code
Here the time may be a little longer, because it is downloaded from the Internet, if it takes too long or the download fails, you can use the image of Taobao to download as follows
npm i -g cnpm --registry=https:registry.npm.taobao.org
Copy the code
cnpm i -g hexo-cil
Copy the code
cnpm i hexo --save
Copy the code
Cil :4.1.0 hexo-cil:4.1.0 hexo-CIL :4.1.0
Initialize hexo
hexo init
Copy the code
Then go to the blog folder. If you see a folder like Source Themes and _config.yml, you are successful
View it on your local server
hexo s
Copy the code
Then open the browser explorer and type locahost:4000, and you’re ready to go. You’ve actually set up your blog
Well fast certain words network speed a little bit better (it is best in the case of scientific Internet) is really ten minutes, but the back of perfect especially my pursuit of beautiful theme (fancy) and like the devil to change the theme and cost the boss effort, but also step on the pit countless, the theme of the devil to change can be a separate story.
Third, publish articles
Posting an article can be done by command
Hexo new < title >Copy the code
It is highly recommended to use Typora software to write directly into the _posts folder of **soruce. This folder is specially designed for your blog posts, but you can’t see your posts on the Internet just by putting it into it. You’d better clean up the cache before using commands to generate pages
hexo clean
Copy the code
hexo g
Copy the code
You can get a preview
hexo s
Copy the code
To see your post, type **locahost:4000** in your browser as before
To upload to the web you first need to find the _config.yml site configuration file ** in the **blog folder you created earlier
Go to the bottom and go to “deploy” type and say “git”.
To deploy to Github, type the following command
hexo d
Copy the code
4. Theme configuration
If you’re not happy with the default theme, you can go to hexo’s theme library to pick it up. If you want to download it, go to Github’s theme clone Repository to download it faster. Once you’ve downloaded it, unzip the file and post it to the theme folder. Then click on the “theme” folder in the “config. Yml” site configuration file in the root directory of the “**blog” file and change it later to the name of the theme folder you just downloaded (also note the space between theme and theme name) **
Here are a few features to recommend: nexT’s minimalist style, Yilia’s simple elegance
Also my blog is the subject of matery