Super detailed Hexo + GitHub + Ali cloud domain name blog to build tutorials, the novice can easily learn

Super detailed Hexo + GitHub + Ali cloud domain name blog to build tutorials, the novice can easily learn

        Quite a long time to explore the construction site to build blog and other things, I originally bought from Ali cloud server and domain names begin to understand these, but also with the pagoda take over the site, think of these things quite interesting, I used the beginning of a pagoda click deployment wordpress blog, I feel very cool, have their own blog, but until I know Hexo this static framework blog I realized this is the real building blog.

        Here's to let me share with you some time to explore my experience out of the fur ------ build Hexo static blog about

         I do follow step by step, you'll have your own blog it! Start

One, node.js first install the prerequisite software environment and Git  

Installing the software is relatively simple, properly installed on the line, I will not go into details, here is the installation address, do not know how you can look at the tutorial of other bloggers.

      node.j installation Address: https://nodejs.org/zh-cn/   

      node.js installation tutorial:   https://blog.csdn.net/qq_42543312/article/details/82191357

      Git installation Address:    https://git-scm.com/  

      Git installation tutorial: https://www.cnblogs.com/xueweisuoyong/archive/2019/11/22/11914045.html

         We can complete the installation in desktop, right-click on Git Bash Here, respectively, enter the following command, if the corresponding version of the message, to prove our node.js and install Git normally available, in addition to talk about the  fact that nodejs npm package manager (package Manager) , can solve many problems on node.js code for deployment, we used in the installation are npm command. npm -v prove our package manager also installed successfully.

git version
node -v
npm -v

                             

Second, the installation Hexo

         The above steps can be carried out after the success HEXO installed, mounted with npm HEXO, enter the following:

npm install hexo-cli -g

         Above represents hexo successful installation, hexo default will be installed to the C drive do not control this

Third, local building Hexo

          Next select a local directory to start creating blog:

          Enter the following command, note: blog is the file you were hexo installed in the current directory folder about what you want to call yourself named, this folder will be automatically generated.

hexo init blog

 

            After entering the command, we can see what you just entered under local directory to create a "blog" folder, this file is hexo local blog

               At this point we continue to enter the next command: This command is used to add some rely hexo the blog

hexo install

         So far our blog hexo local file is ready


          Next we turn hexo local service, start the server:

$ hexo server
#或者可以简写为:
$ hexo s

 

 

           hexo service default port 4000 open, now almost open a browser to access http: // localhost: 4000 you can see your blog it!

          I am not feeling w * c *, w ** f ** k! Good magic ah, ah ha ha ha ha!

Four, GitHub deployment Hexo

           Since deploying blog on github, first of all you have a github account its own

            github official website:      https://github.com/

          Sign up to normal, then click here to create a new warehouse.

           Note here that the warehouse must name format as     your user name .github.io (Note that the user name and not a nickname registration)       is very important here, for example, registered user name: xiaoming, that the name of the warehouse must be set to xiaoming. github.io, then click on the Create Repository

 


            Then we return to the command line, enter the following command, respectively configure their own user name and mailbox in git terminal. Command is as follows:

git config --global user.name XXX   # XXX表示你github注册时的用户名
git config --global user.email XXX  # XXX表示你github注册时的邮箱

            Then enter the following command to generate the key:


ssh-keygen -t rsa -C "Github上你注册的邮箱地址"

To enter a space behind the colon, y / n inputs y  

           Then we can find id_rsa.pub in the directory, where the store is our key to open the copy all the contents

            Then we go back to GitHub Click Setting ---> SSH and GPG keys ---> New SSHkey

       

            Copy the key to a text box, save, Tittle easily play.

 


               Next to a very critical step is we want to have just deployed locally blog document root down to change it _config.yml configuration file:

            I use the editor is VScode, the other can not affect, we will see after opening the configuration crowded, do not panic, we just need to change the following configuration at the bottom of the configuration information

deploy:
  type: 'git'
  repo: [email protected]:yourname/yourname.github.io.git
  branch: master

#需要注意的是:
#1、冒号后面一定要有一个空格
#2、type,repository,branch的首字母要对齐

          As regards the storage address how to find, if not more long-winded about me, will skip it

             

         Copy the address, pay attention to the election HTTP address or addresses can SSH

          Finally, we began to deploy the following command line:

#要安装一个部署插件hexo-deployer-git。
npm install hexo-deployer-git --save

#生成静态文件g 是 generate 缩写
hexo g

#部署,d 是 deploy 缩写:
hexo d


#或者将二、三句结合为
hexo g -d

                 The first deployment will need to enter a user name and password github

                    At this point we can see in our warehouse a lot more files

                 The above process to prove our successful deployment in GitHub, we directly address why accessed via github

                 https://1819597376.github.io/

                  This you will have your own personal web blog, and it excited iron son?

V. binding domain

1, buy a domain name

         First you need to have your own domain name, the domain name to do some interpretation here first

         This domain name (English: Domain the Name ), also known as domain , is separated by a string of dot name consisting Internet on a station computer name or group of computers, used for data transfer location identification of the computer (sometimes It refers to the location). Since the IP address has not show the disadvantages and hard to remember the name and address of the nature of the tissue, the domain name was devised, by the Domain Name System ( the DNS , the Domain the Name the System) to the domain name and the IP address of each map , and more people easy access to the Internet , without having to remember the machine can be directly read the IP address of the number string. 

        Much simpler because the public github too long or the server's IP address digital record is not good, we need a good address to remember also that we need to do a domain name bundled with its own github repository address by this easy to remember domain name to visit our website or blog, such as we do when you want to access Baidu search in the browser address bar directly   baidu.com   can access Baidu web instead of entering long IP address. In DNS, namely the Domain Name System (Service) protocol this binding relationship is stored.

        This is what we aim to do binding domain, buying is not much to say, because my domain name is Ali cloud purchase, here I introduced only in the domain Ali cloud platform, if you want to buy a domain name other platforms may also, our similar operating procedures, not to see the following tutorial purchase

The domain purchase Tutorial:    https://www.jianshu.com/p/e11a136ebd02

2, DNS

         Once you have a domain name, the domain name I want to parse operations to achieve binding domain and our warehouses address.

          We want to add two records

         After you save you can get these two records:

 

              Then back to github repository, create a file named CNAME, content for your domain name:

            At this very moment a miracle happened

                In this way, the perfect ending, to write I'm so tired ah ha ha ha, thanks to the use of this tutorial, you have to build a successful blog Hexo delighted!

                         My blog:    trouble.com

 

 

                                         Last Message

                                                                    No one is born what will

                                                                     Do not say everyone is a genius

                                                                           If you are not

                                                                Please stop it down to earth fantasy

                                                            IT school, do not be afraid to make mistakes, the better error

                                                                                 Goodbye

 

Published an original article · won praise 0 · Views 19

Guess you like

Origin blog.csdn.net/gq1819597376/article/details/104685410