Home > Development Tools > git > Detailed explanation of how to deploy blog to gitee

Detailed explanation of how to deploy blog to gitee

PHPz
Release: 2023-03-28 09:37:04
Original
996 people have browsed it

With the rapid development of Internet technology, blogs have become an important tool for people to display their thoughts and talents. In this process, how to conveniently deploy your own blog is particularly important. As a domestic open source community, gitee not only provides functions such as code hosting and version control, but also provides users with blog deployment services. This article will introduce how to deploy a blog to gitee.

1. Create a warehouse

First, we need to create a warehouse on gitee to store our blog articles. The steps to create a warehouse are as follows:

1. Log in to your gitee account and enter your personal homepage;
2. Click the " " button in the upper right corner and select "New Warehouse";
3. Fill in the warehouse information. Including options such as warehouse name, warehouse description, private or public;
4. Click the "Create Warehouse" button to complete the creation.

2. Choose the blog framework to use

Before deploying the blog to gitee, we need to choose a suitable blog framework. Common blog frameworks include Hexo, Jekyll, VuePress, etc. Here we take Hexo as an example to explain.

3. Install Hexo

1. Install the Node.js environment;
2. Use the command line tool to install Hexo: $ npm install -g hexo-cli ;
3. Create a new Hexo project: $ hexo init blog;
4. Enter the project directory: $ cd blog;
5. Install dependencies: $ npm install.

4. Edit blog content

After completing the installation and configuration of Hexo, you can start writing blog posts. The steps to create a new blog article are as follows:

1. In the Hexo project directory, use the command line tool to create a new article: $ hexo new "article title";
2. Enter "source" in the Hexo project directory /_posts" directory, you can find the newly created article;
3. Use markdown language to write blog content;
4. Save the written blog article.

5. Generate static pages

After we have finished modifying the content of the blog posts, we need to generate them into static pages for users to access. The steps of this process are as follows:

1. Use the command line tool in the Hexo root directory to generate a static page: $ hexo g;
2. Hexo will generate the static page into the "public" folder.

6. Upload static pages to gitee

Next, we need to upload the generated static pages to gitee for others to access. The steps of this process are as follows:

1. Create a warehouse named "username.github.io" on gitee, where "username" is your username on gitee;
2 , copy all files in the public folder to the newly created warehouse;
3. Submit the changes and push the generated static page to gitee.

7. Visit the blog

After the above steps, we have successfully deployed the blog to gitee. At this point, we can access our blog by accessing "http://username.github.io".

Conclusion

This article introduces the steps on how to deploy a blog to gitee. You can choose the appropriate blog framework according to your needs and deploy your own on gitee. blog. At the same time, by deploying the blog to gitee, you can also enjoy free domain names and CDN services, bringing a better access experience to our blog.

The above is the detailed content of Detailed explanation of how to deploy blog to gitee. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template