hexo 博客 seo 优化

个人博客:凌霄的博客

翻开seo

  • 主题配置文件中找到:

seo: false

将其设置为true

百度链接提交

  • 自动提交:

    • 翻开主题配置文件,找到 baidu_push,将其设置为 true

baidu_push: true
  • 《hexo 博客 seo 优化》

sitemap

  • 起首装置两个插件:

npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
  • 然后翻开百度站长平台

  • 《hexo 博客 seo 优化》

  • 增加

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"  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 %}

完成!

迎接批评

    原文作者:逸风
    原文地址: https://segmentfault.com/a/1190000009254968
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞