Hexo與SEO

寫到這邊才發現我忘了SEO這回事了,這邊寫個筆記。

安裝 Hexo 外掛

1
npm install hexo-generator-sitemap --save

_config.yml檔案加入:

1
2
sitemap:
path: sitemap.xml

hexo g -d,重新編譯發佈,以下網址驗證一下是否建出

1
https://hand79.github.io/Blog//sitemap.xml

提交至 Google Search Console

  1. 打開 Google Search Console
  2. 進入「索引 > Sitemap」
  3. 「新增 Sitemap」:sitemap.xml

註: 若網站google-site-verification還沒處理,google會有幾個方案給你驗證網站的所有權,我選擇meta方案。

1
<meta name="google-site-verification" content="XXXXX" />