左本Web3D 左本Web3D
首页
  • Cesium案例

    • 地形|模型加载,地图绘制测量 (opens new window)
    • 基于若依三维Gis可视化系统 (opens new window)
  • Mapbox案例

    • 养殖场模型渲染 (opens new window)
    • 近海阀式养殖 (opens new window)
  • Three案例

    • 学习案例
    • 网络案例,附源码地址
  • Three+D3

    • Demo | D3.js SVG Maps and Three.js (opens new window)
    • Demo | MapBox with D3.js and Three.js (opens new window)
  • 项目案例

    • 消防楼物联网三维可视化大屏
    • 智慧养殖三维可视化大屏
    • 智慧农田三维可视化大屏
    • 智慧城市运营管理平台
    • 智慧设备运维综合管理平台
    • 设备运维管理系统
    • 网格工具
    • 博物馆VR全景
    • 数字虚拟展厅
  • 在线访问

    • 网格工具 (opens new window)
    • 博物馆VR全景 (opens new window)
    • AI数字人 (opens new window)
    • 水厂3D可视化 (opens new window)
    • 3D地图 (opens new window)
  • 链接工具

    • Web3D相关链接
    • Gis相关链接
  • 小游戏

    • 吃什么? (opens new window)
CSDN (opens new window)
Gitee (opens new window)
GitHub (opens new window)
备用地址 (opens new window)

左本Web3D

专注Web3D技术领域
首页
  • Cesium案例

    • 地形|模型加载,地图绘制测量 (opens new window)
    • 基于若依三维Gis可视化系统 (opens new window)
  • Mapbox案例

    • 养殖场模型渲染 (opens new window)
    • 近海阀式养殖 (opens new window)
  • Three案例

    • 学习案例
    • 网络案例,附源码地址
  • Three+D3

    • Demo | D3.js SVG Maps and Three.js (opens new window)
    • Demo | MapBox with D3.js and Three.js (opens new window)
  • 项目案例

    • 消防楼物联网三维可视化大屏
    • 智慧养殖三维可视化大屏
    • 智慧农田三维可视化大屏
    • 智慧城市运营管理平台
    • 智慧设备运维综合管理平台
    • 设备运维管理系统
    • 网格工具
    • 博物馆VR全景
    • 数字虚拟展厅
  • 在线访问

    • 网格工具 (opens new window)
    • 博物馆VR全景 (opens new window)
    • AI数字人 (opens new window)
    • 水厂3D可视化 (opens new window)
    • 3D地图 (opens new window)
  • 链接工具

    • Web3D相关链接
    • Gis相关链接
  • 小游戏

    • 吃什么? (opens new window)
CSDN (opens new window)
Gitee (opens new window)
GitHub (opens new window)
备用地址 (opens new window)
  • 技术文档

    • Git使用手册
    • Markdown使用教程
    • npm常用命令
    • npm packageJson属性详解
    • yaml语言教程
  • GitHub技巧

    • GitHub高级搜索技巧
    • GitHub Actions 实现自动部署静态博客
    • GitHub Actions 定时运行代码:每天定时百度链接推送
    • GitHub加速下载项目的方法
  • Nodejs

    • nodejs递归读取所有文件
  • 博客搭建

    • 解决百度无法收录搭建在GitHub上的个人博客的问题
      • 背景
      • 解决方案
        • 如何知道百度有没有收录?
      • 相关文章
    • 使用Gitalk实现静态博客无后台评论系统
    • GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床
    • vdoing主题效果图
  • 技术
  • 博客搭建
xugaoyi
2019-12-25
目录

解决百度无法收录搭建在GitHub上的个人博客的问题

# 解决百度无法收录搭建在GitHub上的静态博客的问题

注意

如果你正在寻找本博客的搭建文档,博主建议您查看这个仓库的README (opens new window)。

# 背景

由于GitHub禁止百度爬虫访问,造成托管在GitHub Pages上的博客无法被百度收录。相关问题可以通过百度站长平台的抓取诊断再现,每次都是403 Forbidden的错误。

# 解决方案

同时将博客同时同步托管到GitHub Pages和coding pages (opens new window)上,解决百度不收录问题。最后发现在国内使用coding pages打开速度特别快,而且还会被百度收录,因此我把coding pages的站点作为主站点,原本在github pages的作为分站点。

步骤:

1、注册coding (opens new window)账号,创建仓库,把代码推送到coding仓库,并开启pages服务。

git 操作部分和使用github的差不多,不了解git操作的可以看我的另一篇文章:Git使用手册 (opens new window)

2、我的博客项目使用vuepress搭建的,使用的是如下自动部署脚本,同时将代码推送到github和conding。

#!/usr/bin/env sh

# 确保脚本抛出遇到的错误
set -e

# 生成静态文件
npm run build

# 进入生成的文件夹
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 # 发布到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 # 发布到coding

cd - # 退回开始所在目录
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

因为我想给两个平台上绑定不同的自定义域名,因此我分开创建了CNAME文件。

3、有自定义域名的,也可以在coding pages绑定自定义域名,域名DNS解析中添加CNAME记录指向coding pages的站点地址即可。(没有自定义域名的可忽略,同时把自动部署脚本中的创建CNAME文件的脚本去掉)

最后,使用百度站长的抓取诊断,发现抓取成功啦,再使用百度站长的链接提交 (opens new window)功能,把链接提交给百度,过一段时间就可能在百度搜索中搜索到啦。

# 如何知道百度有没有收录?

在百度搜索框中使用site:<链接地址>,如:

site:xugaoyi.com
1

# 相关文章

《GitHub Actions 定时运行代码:每天定时百度链接推送》 (opens new window)

上次更新: 2023/08/25, 16:22:35
nodejs递归读取所有文件
使用Gitalk实现静态博客无后台评论系统

← nodejs递归读取所有文件 使用Gitalk实现静态博客无后台评论系统→

最近更新
01
我做了一个手写春联小网页,祝大家虎年暴富 原创
01-28
02
一行代码“黑”掉任意网站 原创
11-25
03
33个非常实用的JavaScript一行代码
11-02
更多文章>
Theme by Vdoing | Copyright © 2023-2025 左本
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式