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

完成!

欢迎评论

相关文章
相关标签/搜索