如何针对Hexo博客的Next主题做SEO优化,提升个人博客排名?
SEO概念
SEO
本文所有的优化主要是两方面:1、针对个人网站的页面排版进行SEO的优化,2、针对搜索引擎进行主动的优化
针对搜索引擎优化
添加sitemap
参考之前文章Hexo博客添加sitemap
添加蜘蛛协议robots
网站结构自身优化
出站链接添加nofollow标签
[nofollow]概述(https://baike.baidu.com/item/Nofollow/2410595?fr=aladdin)
Hexo的Next主题需要改以下几个地方:
1、footer.swig文件
目录位置:
1 | $ ls -al your-hexo-site/themes/next/layout/_partials/footer.swig |
修改方法:
修改以下两处a标签添加rel=”external nofollow”属性
1 | {{ __('footer.powered', '<a class="theme-link" rel="external nofollow" href="https://hexo.io">Hexo</a>') }} |
2、sidebar.swig文件
文件位置:
1 | $ ls -al your-hexo-site/themes/next/layout/_macro/sidebar.swig |
修改方法:
修改以下一处a标签添加rel=”external nofollow”属性
1 | <a rel="external nofollow" href="https://creativecommons.org/{% if theme.creative_commons === 'zero' %}publicdomain/zero/1.0{% else %}licenses/{{ theme.creative_commons }}/4.0{% endif %}/" class="cc-opacity" target="_blank"> |
添加keywords和description
在文章模板中scaffolds/post.md中添加如下代码,用于生成的文章中添加关键字和描述。
1 | keywords: |
首页title优化
更改index.swig文件,文件路径是
1 | ``` text |
修改文章链接
参考之前的文章Hexo之URL持久化
======================================================
希望各位朋友支持一下
- 领取我的阿里云幸运券,谢谢.
- 使用腾讯云资源
- Linode VPS
- 搬瓦工VPS
- 阿里云1888元云产品通用代金券点我
- 阿里云最新活动全民云计算升级-拼团上云更优惠
本文作者:dongsheng
本文地址: https://mds1455975151.github.io/archives/91c0d0bf.html
版权声明:转载请注明出处!


