Home Development Tools git How to write a github blog

How to write a github blog

May 17, 2023 am 09:42 AM

GitHub is the largest open source community in the world, no one. It not only provides the world's largest code hosting platform, but also an open source community where developers can publish their own open source projects and participate in the contribution and maintenance of open source projects.

GitHub blog is a static blog built on GitHub using Jekyll and GitHub Pages. It supports Markdown syntax and is a good choice for technical writers and programmers. How to set up your own blog on GitHub? Let’s take a look at it step by step.

  1. Create a warehouse

First enter your GitHub account, click " " on the upper right, select "New repository", and then when naming the warehouse, the format is "User" name.github.io", where "username" is your username on GitHub. For example, my GitHub username is "DongXXI", then the name of the created warehouse is "DongXXI.github.io".

  1. Install Jekyll and GitHub Pages

Install Jekyll and GitHub Pages locally. This is a necessary condition for previewing and updating your blog locally. GitHub Pages supports the installation of Jekyll. You can follow the official documentation for installation. After the installation is complete, you can use Jekyll to create a new template and build a blog locally.

Note: If you are using a Windows system, the installation steps for Jekyll may be slightly different. Please refer to the Jekyll official website.

  1. Create a blog template

You can edit it directly when previewing locally or use a Jekyll template made by others

How to build your own blog on GitHub Woolen cloth? Let’s take a look at it step by step.

Board, using the syntax Markdown. In Jekyll, the template is mainly divided into the following parts:

  • YAML header information: contains metadata information of the blog post, such as title, date, author, etc.
  • Blog text: Written using Markdown syntax, used to create the main content of blog posts.
  • Blog structure: generally the navigation of the blog, bottom tags and other HTML content.

You can download a ready-made template from GitHub, or you can customize a template yourself and build it from scratch.

  1. Upload the template to the GitHub repository

After modifying the blog template locally, push the modified files to the GitHub repository to complete the upload. Execute the following command locally:

git add .
git commit -m "first commit"
git push origin main
Copy after login

to push the local blog template to GitHub.

  1. Configure GitHub Pages

Open the GitHub warehouse page, click "Settings", select the theme and release source in "GitHub Pages", the default is to use "master brunch/ docs folder", you can select "main brunch", and then click "Save".

  1. Visit the blog

After the blog template is successfully uploaded to GitHub, enter "https://username.github.io" in the browser to access the blog. If no domain name is specifically set, the blog name is the username.

  1. Customize your own blog theme

The above steps are almost enough to create your own blog, but if you want to make your blog more unique, you can find some on GitHub Free or paid blog themes, such as jekyll homepage theme, jekyll-stress-themes, etc. You can find many ready-made themes by searching for jekyll themes on GitHub.

After the selection is completed, download it locally and then upload it to GitHub Pages. Note that some themes may require the installation of some plug-ins, which need to be installed according to the installation instructions provided by the theme.

Summary

So far, we have learned how to build our own blog on GitHub. Although this method is not as convenient as ordinary blogging platforms, it is more free. , independence, and a more convenient way to maintain and upgrade. So, cherish life, stay away from small talk, and go try it!

The above is the detailed content of How to write a github blog. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1243
24
How to download git projects to local How to download git projects to local Apr 17, 2025 pm 04:36 PM

To download projects locally via Git, follow these steps: Install Git. Navigate to the project directory. cloning the remote repository using the following command: git clone https://github.com/username/repository-name.git

How to update code in git How to update code in git Apr 17, 2025 pm 04:45 PM

Steps to update git code: Check out code: git clone https://github.com/username/repo.git Get the latest changes: git fetch merge changes: git merge origin/master push changes (optional): git push origin master

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to generate ssh keys in git How to generate ssh keys in git Apr 17, 2025 pm 01:36 PM

In order to securely connect to a remote Git server, an SSH key containing both public and private keys needs to be generated. The steps to generate an SSH key are as follows: Open the terminal and enter the command ssh-keygen -t rsa -b 4096. Select the key saving location. Enter a password phrase to protect the private key. Copy the public key to the remote server. Save the private key properly because it is the credentials for accessing the account.

How to return after git submission How to return after git submission Apr 17, 2025 pm 01:06 PM

To fall back a Git commit, you can use the git reset --hard HEAD~N command, where N represents the number of commits to fallback. The detailed steps include: Determine the number of commits to be rolled back. Use the --hard option to force a fallback. Execute the command to fall back to the specified commit.

Git vs. GitHub: Version Control and Code Hosting Git vs. GitHub: Version Control and Code Hosting Apr 11, 2025 am 11:33 AM

Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions and supports local operations; GitHub provides online collaboration tools such as Issue tracking and PullRequest.

How to merge code in git How to merge code in git Apr 17, 2025 pm 04:39 PM

Git code merge process: Pull the latest changes to avoid conflicts. Switch to the branch you want to merge. Initiate a merge, specifying the branch to merge. Resolve merge conflicts (if any). Staging and commit merge, providing commit message.

What to do if the git download is not active What to do if the git download is not active Apr 17, 2025 pm 04:54 PM

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

See all articles