当前位置: 首页 > Web前端 > HTML

hexo博客seo优化

时间:2023-04-03 00:28:05 HTML

个人博客:凌霄的博客打开seo在主题配置文件中找到:seo:false设置为true百度链接提交自动提交:打开主题配置文件,找到baidu_push,设置为truebaidu_push:truesitemap首先安装两个插件:npminstallhexo-generator-sitemap--savenpminstallhexo-generator-baidu-sitemap--save然后打开百度站长平台添加http://lx.nextdev.top/baidusitemap.xmlhttp://lx.nextdev.top/sitemap.xml添加robots.txt#hexorobots.txtUser-agent:*Allow:/Allow:/archives/Disallow:/vendors/Disallow:/js/Disallow:/css/Disallow:/fonts/Disallow:/vendors/Disallow:/fancybox/Sitemap:你的域名/sitemap.xmlSitemap:你的域名/baidusitemap.xml放在blog/source/目录下,出站链接添加nofollow属性:打开blog\themes\next\layout\_partials\footer.swig文件为以下链接添加了nofollow属性:{{__('footer.powered','Hexo')}}打开博客\themes\next\layout_macro,添加以下代码中的标签添加无跟随属性:{{name}}标题优化打开your-hexo-site\themes\next\layout\index.swig,放入如下代码:{%blocktitle%}{{config.title}}{%endblock%}更改为{%blocktitle%}{{config.title}}-{{theme.description}}{%endblock%}完成!欢迎评论