Deploy a static website for free on Github

    For a simple static website, you can directly hang it on github. Why is this recommended, because it is free. Of course, if the performance requirements are high, or the website involves a database, it cannot be handled as simply as this, and it must be honestly the same as the introduction to website construction .

    The simple steps to deploy a static website for free on Github are as follows:

    1. Install git

    2. Configure SSH keys (convenient for code submission)

    Enter a command in git-bash, similar to the following:

    ssh-keygen -t rsa -C "your mailbox".

    

    When you see Enter passphrase, enter the password of your (corresponding email) github account, repeat the input, and then the above prompt will appear, and the following files will be generated in the specified directory.


    Open the id_rsa.pub file and copy the entire contents. Then open the github webpage, log in, find the ssh key management in the settings, create a new key, and paste the content.


    After the addition is successful, one more line will appear.


    3. Create a new warehouse Repository


    Once the repository is created, copy the repository link.


    4. Website upload and configuration

    4.1 Clone the existing repository, that is, download the repository we created earlier.

    


    Waiting for the clone to complete, the corresponding warehouse content will be generated on the specified path.

    4.2 Copy the project to the repository folder.

   

      4.3 Upload the modified project again

      Click Stage Changed, Continue, Sign Off, Commit and Push.

    There may be an Unable to obtain your identity error when using GitGui, the solution .

    Waiting for the upload to complete, you can check on the webpage that the content of the warehouse has been updated.

    4.4 Choose a default theme

    After clicking to create a repository, click Settings in the main repository page, enter the settings page, find GitHub Page, and select the Choose a theme button to choose a default theme for the website.


    After selecting the finished theme, _config.yml will appear in the repository.

    After selecting the finished theme, _config.yml will appear in the repository. After submitting the changes, enter the Settings interface again, and find the GitHub Page. At this time, a URL will appear, which means the configuration is successful.


Example website: https://jack13163.github.io/WebSite/

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326786622&siteId=291194637