Home  >  Article  >  Development Tools  >  How to build a personal website on gitee

How to build a personal website on gitee

PHPz
PHPzOriginal
2023-03-31 09:07:432801browse

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:

  1. Minimal Mistakes: This is a very popular Jekyll theme that is based on Bootstrap and has a responsive design that adapts perfectly to various screen sizes.
  2. Lanyon: This is a simple Jekyll theme. Its design style is very suitable for personal websites such as literature, reading and writing.
  3. Pixyll: This is a very simple Jekyll theme. Its design is very suitable for personal websites that only need a simple page to display their information and works.

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:

  1. title: website name.
  2. email: Email address.
  3. author: author name.
  4. description: Website description.
  5. url: Website address, which needs to be set to "https://yourusername.gitee.io".
  6. github_username: Your Github username.
  7. twitter_username: Your Twitter username. Configuration items in

index.md file:

  1. title: website name.
  2. subtitle: website subtitle.
  3. features: A list of website features.
  4. about: About your introduction.
  5. footer-links: List of footer links.

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn