Home > Article > Development Tools > How to build a personal website on gitee
As a programmer, we often need to share the code and projects we write with other developers. At this time, a personal website is very important, allowing others to understand our technical level and capabilities in one place. There are many personal website building tools, such as WordPress, which I have heard of, but for developers, it may be more suitable to use static website building methods such as GitPages or Gitee Pages. Today we will talk about how to build a personal website on Gitee. website.
1. Create a warehouse
First, we need to create a code warehouse on Gitee. What we need to pay attention to here is that the name of the warehouse needs to comply with the specification of "username.gitee.io". That is to say, if your username is "example", then the name of the repository you create needs to be "example.gitee.io". After creating the warehouse, we need to clone the warehouse locally.
2. Prepare template
Next, we need to choose a template to build our personal website. Here we provide several templates that can be used to build personal websites:
After selecting the template, we need to download the template locally and extract it to the warehouse directory.
3. Modify the configuration file
In the warehouse directory, we need to modify the two files _config.yml and index.md. Configuration items in
_config.yml:
index.md file:
After the modification is completed, to run the Jekyll service locally, you can use the following command:
$ jekyll serve
4. Publish the website
After running the Jekyll service locally, we can Preview the website by visiting http://127.0.0.1:4000. If everything is fine, we can publish the website to Gitee.
Continue to run the Jekyll service locally, open a new terminal, and enter the following command:
git add . git commit -m "Initial commit" git push
After that, you can see our website on Gitee. You can view the website by visiting https://username.gitee.io in your browser.
5. Customize your personal website
The above is to use other people’s Jekyll themes to build your personal website, but if you want a personalized website, you need to modify the corresponding web page files. Modification, for example, if you want to modify the layout of the homepage, you need to modify the index.html file, if you want to add an about page, you need to create an about.html file, etc.
In short, through these steps, you can easily build your own personal website on Gitee. It is very convenient and highly playable. You can use different templates and custom themes to build and design your personal website.
The above is the detailed content of How to build a personal website on gitee. For more information, please follow other related articles on the PHP Chinese website!