hexo 博客 seo 優(yōu)化

個人博客:凌霄的博客

打開seo

  • 主題配置文件中找到:
seo: false

將其設(shè)置為true

百度鏈接提交

  • 自動提交:
  • 打開主題配置文件,找到 baidu_push,將其設(shè)置為 true
baidu_push: true
  • 鏈接提交

sitemap

  • 首先安裝兩個插件:
npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
  • 然后打開百度站長平臺
Paste_Image.png
  • 添加
http://lx.nextdev.top/baidusitemap.xml
http://lx.nextdev.top/sitemap.xml

  • 添加 robots.txt

# hexo robots.txt
User-agent: * Allow: /
Allow: /archives/
Disallow: /vendors/
Disallow: /js/
Disallow: /css/
Disallow: /fonts/
Disallow: /vendors/
Disallow: /fancybox/
Sitemap: 你的域名/sitemap.xml
Sitemap: 你的域名/baidusitemap.xml
  • 放在博客/source/目錄下

給出站鏈接加上no follow屬性:

打開博客\themes\next\layout\_partials\footer.swig 文件
給下列鏈接加上no follow屬性:

{{ __('footer.powered', '<a  class="theme-link"  ) }}
<a class="theme-link" >

打開博客\themes\next\layout_macro,將下面代碼中的a標(biāo)簽加no follow屬性:

<a href="{{ link }}" target="_blank">{{ name }}</a>
<a href="http://creativecommons.org/licenses/{{ theme.creative_commons }}/4.0" class="cc-opacity" target="_blank">

title的優(yōu)化

打開 your-hexo-site\themes\next\layout\index.swig,將下面代碼:

{% block title %}  {{ config.title }}  {% endblock %}

改為

{% block title %}  {{ config.title }} - {{ theme.description }}  {% endblock %}

完成!

歡迎評論

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容