Prior to the start

Writing articles is a great habit for many programmers, and you’ll find it a great thing to do, don’t you?

About making Pages

Github Pages is a web hosting platform for open source and private software projects. It is named github because it only supports Git as the only repository format for hosting. Is not the feeling that xiaobian is a chatterbox, nonsense to say! Well, some of them are, haha!

All right, let’s get to the point. What are Github Pages? In fact, those who know Git will know that it is of course a free static site. In plain English: github is a static page display platform. Github Pages has a few small features that deserve our attention:

  • Simple and free to build;
  • Static script support;
  • Can bind your domain name;

Github Pages is a useful gadget for those who want to showcase small projects. Why is it worth using? Of course “free”, free things don’t have to be given away for nothing, right? Github Pages supports static, static, and static scripts.

Set up steps

Xiaobian now take readers to start building a website! Don’t wander off!

The first step:

The second step:

Log in to Github and create a repository for your site’s files.



Here are some minor issues that you should pay attention to:

  • Github. IO; github. IO; github. For example: hongdeyuan. Making. IO
  • Initialize this repository with a README Initialize this repository with a README Because you can cause conflicts when you push in the local warehouse. Of course, you can also choose to push local reference code, but it is not recommended to push local library code, because it is a “high-risk operation” in the company. , as for what is a “high-risk operation” xiaobian in this will not mention ha, because the content is too much! Git is a dangerous operation.

Step 3:

3. Upload project files/push local library projects, as shown below:



Simply click on the “uploading an existing file.” to upload files one by one! As shown in the figure:



First, initialize the local static project file with git:



Next, add the local project file to the staging area using: git add. Git status check the file status as shown below:



Git commit -a -m’fisrt commit ‘; Git status check the file status as shown below:



Next, connect to a remote warehouse, use: git remote add dhyuan https://github.com/hongdeyuan/hong.github.io; Git remote -v: query the remote connection address as shown in the following figure:



Finally, push the local repository code to the remote repository using Git push dhyuan master, as shown in the figure below:



So far, xiaobian will lead you to submit the local library project, so we will check it, go to remote Github check; As shown below:



Did you succeed? No accident, it should be a success! Check whether “Initialize this repository with a README” is selected, otherwise, this step will reject your code push oh, so you must use “high-risk operation” : Git push dhyuan master -f

Step 4:

4. Click “Settings” to enter the Settings. : After entering the Settings, pull down to find the GitHub Pages Settings interface, as shown below:



Next, select the topic and submit:


[Special reminder] :

  • The GH-Pages branch is used for building and publishing;
  • If the user/org pages uses a separate domain, all project pages hosted under the account will be redirected using the same domain, unless the project Pages uses its own separate domain.
  • If not use independent domain name, project pages will provide services through subpath username.github.com/projectname;
  • Custom 404 Pages can only be used under independent domain names. Otherwise, User Pages 404 will be used.


Step 5:

Verify that the blog page you created was successful



At this moment, we have witnessed the construction of a website, quickly move to play next!

   

See you next time!