百度收录很蛋疼
在此之前用过@小康写的hexo-baidupush
很不错。
由于Bing和Google只爬sitemap.xml收录已经很快了,但总是爬sitemap.xml效率肯定没Api提交的快。
自己写了Bing的定时自动提交,目前还不支持Google定时自动提交,因为Google的API提交方式很鸡肋
Google indexing API有两个问题
- 账户安全密钥不能被泄露(谷歌只支持这种提交方式,对于没有后台的hexo来说是很致命的)
- API提交只能使用json,而这个json格式只能包含一个网站url链接
不能多url放到一个json里,所以需要多次请求提交(baidu、bing、只需一次请求)
Google 最优提交方案是本地提交(能解决以上两个问题)
如果你有什么好的处理方案欢迎与我交流
正文
安装插件
npm i hexo-seo-autopush --save
配置
在hexo 的config.yml里添加
hexo-seo-autopush配置
# enable: 开启/关闭 推送
# count: 每次提交最新的10篇文章
# https://github.com/lete114/hexo-seo-autopush
hexo_seo_autopush:
baidu:
enable: true
count: 100
bing:
enable: true
count: 10
google:
enable: true
count: 10
google_file: google_service_account.json # 谷歌服务账户
添加Google Push
配置和解决push后没有GitHub Actions .github\workflows\AutoPush.yml
文件的问题
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
- type: git
repo: https://github.com/lete114/Test.git
branch: main
ignore_hidden: