VDone Demo VDone Demo
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)

Nikolay Tuzov

Backend Developer
Home
  • Articles

    • JavaScript
  • Study Notes

    • JavaScript Tutorial
    • Professional JavaScript
    • ES6 Tutorial
    • Vue
    • React
    • TypeScript: Build Axios from Scratch
    • Git
    • TypeScript
    • JS Design Patterns
  • HTML
  • CSS
  • Technical Docs
  • GitHub Tips
  • Node.js
  • Blog Setup
  • Learning
  • Interviews
  • Miscellaneous
  • Practical Tips
  • Friends
About
Bookmarks
  • Categories
  • Tags
  • Archives
GitHub (opens new window)
  • 技术文档

  • GitHub技巧

  • Nodejs

  • 博客搭建

    • Solving Baidu's Inability to Index Personal Blogs Hosted on GitHub
      • Background
      • Solution
        • How to Check if Baidu Has Indexed Your Site
      • Related Articles
    • Implementing a Serverless Comment System for Static Blogs with Gitalk
    • GitHub + jsDelivr + TinyPNG + PicGo - Building a Stable, Fast, and Free Image Hosting Solution
    • Vdoing Theme Screenshots
  • 技术
  • 博客搭建
xugaoyi
2019-12-25
Contents

Solving Baidu's Inability to Index Personal Blogs Hosted on GitHub

# Solving Baidu's Inability to Index Static Blogs Hosted on GitHub

Warning

If you're looking for this blog's setup documentation, I recommend checking the README (opens new window) of this repository.

# Background

Since GitHub blocks Baidu's web crawlers, blogs hosted on GitHub Pages cannot be indexed by Baidu. This can be reproduced through Baidu Webmaster's Fetch as Baidu tool, which consistently returns 403 Forbidden errors.

# Solution

Host the blog simultaneously on both GitHub Pages and Coding Pages (opens new window) to solve the Baidu indexing problem. I discovered that Coding Pages loads particularly fast within China and gets indexed by Baidu, so I made the Coding Pages site my primary site and the GitHub Pages one a secondary site.

Steps:

  1. Register a Coding (opens new window) account, create a repository, push your code to the Coding repository, and enable the Pages service.

The git operations are similar to GitHub. If you're unfamiliar with git operations, see my other article: Git User Manual (opens new window)

  1. My blog project is built with VuePress, using the following auto-deployment script to push code to both GitHub and Coding simultaneously.
#!/usr/bin/env sh

# Abort on errors
set -e

# Build static files
npm run build

# Enter the built files directory
cd docs/.vuepress/dist

# github
echo 'b.xugaoyi.com' > CNAME
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:xugaoyi/blog.git master:gh-pages # Deploy to GitHub

# coding
echo 'xugaoyi.com' > CNAME
git add -A
git commit -m 'deploy'
git push -f git@git.dev.tencent.com:xugaoyi/xugaoyi.git master # Deploy to Coding

cd - # Return to the original directory
rm -rf docs/.vuepress/dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

I created separate CNAME files because I wanted different custom domains for the two platforms.

  1. If you have a custom domain, you can also bind it in Coding Pages. Just add a CNAME record in your DNS settings pointing to the Coding Pages site address. (If you don't have a custom domain, skip this and remove the CNAME file creation from the deployment script.)

Finally, using Baidu Webmaster's Fetch tool, I confirmed that fetching succeeded! Then I used Baidu Webmaster's Link Submit (opens new window) feature to submit links to Baidu. After some time, the pages may appear in Baidu search results.

# How to Check if Baidu Has Indexed Your Site

Use site:<link-address> in the Baidu search box, like:

site:xugaoyi.com
1

# Related Articles

GitHub Actions: Scheduled Code Execution for Daily Baidu Link Pushing (opens new window)

Edit (opens new window)
Last Updated: 2026/03/21, 12:14:36
Node.js Recursively Read All Files
Implementing a Serverless Comment System for Static Blogs with Gitalk

← Node.js Recursively Read All Files Implementing a Serverless Comment System for Static Blogs with Gitalk→

Recent Updates
01
How I Discovered Disposable Email — A True Story
06-12
02
Animations in Grid Layout
09-15
03
Renaming a Git Branch
08-11
More Articles >
Theme by VDone | Copyright © 2026-2026 Nikolay Tuzov | MIT License | Telegram
  • Auto
  • Light Mode
  • Dark Mode
  • Reading Mode