hexo 博客 seo 優化

我的博客:凌霄的博客css

打開seo

  • 主題配置文件中找到:git

seo: false

將其設置爲truegithub

百度連接提交

  • 自動提交:npm

    • 打開主題配置文件,找到 baidu_push,將其設置爲 truehexo

baidu_push: true
  • 連接提交

sitemap

  • 首先安裝兩個插件:優化

npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
  • 而後打開百度站長平臺spa

  • 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/目錄下code


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

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

{{ __('footer.powered', '<a  class="theme-link"  href="http://hexo.io">Hexo</a>') }}
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">

打開博客\themes\next\layout_macro,將下面代碼中的a標籤加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的優化

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

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

改成

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

完成!

歡迎評論

相關文章
相關標籤/搜索