Home > Development Tools > git > How to use Gitee Pages to deploy static websites and interactive functions

How to use Gitee Pages to deploy static websites and interactive functions

PHPz
Release: 2023-03-30 16:37:25
Original
3161 people have browsed it

Gitee is a very well-known Git code hosting platform. Not only can you manage code on Gitee, you can also deploy your own static website through Gitee Pages, which is very convenient. This article will introduce how to use Gitee Pages to deploy a static website and how to add interactive features to make the website more lively and interesting.

1. Create a Gitee Pages project

First you need to create a Pages project on Gitee. The specific operations are as follows:

  1. Log in to the Gitee website and enter your personal homepage.
  2. Click the "Create Warehouse" button.
  3. Set the warehouse name, check the "Public" option, select the "Initialize README.md" option, and finally click the "Create Warehouse" button.
  4. Enter the newly created warehouse page and click the "Settings" button.
  5. Click the "Pages Service" tab and select the "Enable Pages Service" button.
  6. Set the access path of the website and the default displayed page, for example, set it to "/my-website", the default displayed page is "index.html", and finally click the "Save" button.
  7. Next, you can create a new folder locally and put the relevant files of the static website into this folder.
  8. Open the command line locally, enter the folder you just created, and enter the following command:

git init
git add .
git commit -m "initial commit "

  1. Connect to the Gitee repository and enter the following command:

git remote add origin [Gitee repository address]
git push -u origin master

  1. After completing the above steps, refresh the Gitee warehouse page and you will see the deployed static website.

2. Add interactive functions

On the basis of a static website, adding interactive functions can make the website more lively and interesting. Here are two ways to add interactive functionality.

  1. Using JavaScript

JavaScript is a scripting language that can achieve page interaction effects. You can add

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template