Hexo 站点的SEO配置
Hexo 站点的SEO配置
Hexo Blog 配置SEO主要用到两个插件hexo-generator-sitemap,hexo-submit-urls-to-search-engine
重要步骤
- Google账号的话激活Google Cloud
- 根据文档步骤完成服务账号创建和密钥创建
- 密钥创建成功后下载密钥的json文件到hexo根目录下,并在_config.yml中配置
- https://www.google.com/webmasters/verification/home
- 会自动跳到新后台,使用『网址前缀』方式验证所有权,会生成googleaXXXXXX.html 文件
- download 下载到hexo 的source目录下
- 完成站点验证
- 登录https://search.google.com/search-console
- 在『设置』-> 『用户和权限』 ->『添加用户』 将密钥json文件中的client_email中邮箱(就是第一步在Google中创建的服务账号对应的邮箱)添加
- 指定权限为所拥有者

代码
1 | npm install hexo-submit-urls-to-search-engine --save |
Config 配置
1 | hexo_submit_urls_to_search_engine: |
推送成功
1 | Google response: { |
问题处理
1 | Google response: { |
参考文档
- https://github.com/cjh0613/hexo-submit-urls-to-search-engine
插件github地址
- https://cjh0613.com/20200603HexoSubmitUrlsToSearchEngine
hexo-submit-urls-to-search-engine 插件使用说明
!! Indexing API 允许网站所有者在发布招聘信息或直播时直接通知 Google 添加或删除视频页面。这允许 Google 安排页面进行新的抓取, 可以带来更高质量的用户流量。Indexing API 只能用于抓取具有以下特征的页面: JobPosting 或 嵌入在 VideoObject 中的 BroadcastEvent 。对于包含许多短期页面(例如招聘信息或直播视频)的网站,Indexing API 允许单独推送更新,从而使搜索结果中的内容保持最新。 - https://github.com/hexojs/hexo-generator-sitemap
用来生成sitemap.xml 文件
- https://developers.google.cn/search/apis/indexing-api/v3/prereqs
- https://zhuanlan.zhihu.com/p/651590960