Implementation effect picture:

My project is: github.com/shunyue1320… I need to project to create an official document page, such as: shunyue1320. Making. IO/uab – the UI

Github projects have a big official document. How does this work? In fact, it is very simple, let’s do it ourselves!

1. Create a docs file in the project root directory

A docs file is simply the information described in the official documentation of your project.

Let’s take VuePress as an example. The purpose of VuePress is to make it easier to write an official document for a project.

Through learning the use of VuePress, I successfully wrote an official document for my project with VuePress. This is the code to complete an official document with VuePress, including the webpage displayed after it was launched! If you’re interested, you can study it.

2. Package the document project and upload it to the project branch

So how do we get the documentation on line? And display it in the form of “https:// username.github. IO/file name “!

Here comes the hardcore knowledge…. Check out the official VuePress documentation to see how the project documentation is deployed on Github. Sh file is created in the root directory of the project and run the Bash deploy.sh file on the Git Bash Here command line

Sh file is as follows:

#!/usr/Set -e # generate static file NPM run docs:build # Enter generated folder CD docs/.vuepress/dist # If published to custom domain name # echo'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'# if you publish to HTTPS://<USERNAME>.github.io# git push -f [email protected]:<USERNAME>/<USERNAME>.github. IO.//
      
       .github. IO /
       
         (this means to post the docs package to the gh-Pages branch of your github project)
       
      
git push -f [email protected]:shunyue1320/uab-ui.git master:gh-pages

cd -
Copy the code

Ok, we successfully created the deploy.sh file and ran it. This is a problem. Git SSH Permission denied (publickey) git SSH Permission denied (publickey) GitHub is a public code management platform. As long as it is a public code management platform, there will be security problems, and the platform developers will definitely implement some measures to avoid these security problems. For example, the browser implements the same origin policy. Only with the cooperation of public key and private key can we push the code into our own project to avoid being misoperated by others.

Now that we know why, let’s configure itgithubPublic key and local private key bar!

  1. Command line operationssh-keygenSSH key file address:C:\Users\ your username \.ssh

When generating the SSH key, you will be prompted to enter the filekey and passphrase2. Run the SSH key file address command to generate the file addressid_rsa.pubCopy the contents inside toGitHub SSH key, then set title, and clickAdd SSH key save SSHThe key value is sufficient. GitHub SSH key:Github.com/settings/ke… Now let’s try again inGit Bash HereYou can enter commands on the clibash deploy.shRun this file,GitHubA successful project namedgh-pagesbranchAs follows: Github.com/shunyue1320…And then the final step, passGitHubDeploy the project document to the url:”Https://username.github. IO/file name”

3. Online deployment project document

Enter theGitHubEntry into the projectsettingsSet up thegithub pagesBranch is the gh-Pages Branch, select root for the entry file, and finally save, the project is successfully launched!! I’m in aprojectIs to teach you to write a vUE simplified version of the UI library, let you learn toelement , Ant DesignThese mega-factoriesUI libraryWhat is the realization principle of “, if you need reference, welcome star, click a like, so that you can not find my project quickly next time! Thank you so much for being here!!shunyue1320.github.io/uab-ui Your love is the biggest motivation for my creation. Thank you!