seo优化之准备工作
生成站点地图 sitemap.xml和baidusitemap.xml在根目录下,打开git bash输入如下命令:
123npm install hexo-generator-sitemap --save npm install hexo-generator-baidu-sitemap --save
在站点目录的配置文件_config.yml中添加如下代码:
12345# 自动生成sitemapsitemap:path: sitemap.xmlbaidusitemap:path: baidusitemap.xml
这样每次执行完heox generator,都会在/Pub
...
hexo的seo优化之s首页标题优化
首页标题优化seo最重要的是你的标题,一般搜索都是搜索你的标题。更改themes\next\layout\index.swig文件
1{% block title %} {{ config.title }} {% endblock %}
改成
1{% block title %} {{ config.title }} - {{ theme.description }} {% endblock %
...
seo优化之关键词与描述
关键词与描述搜索引擎除了捉取标题外,页面的关键词和描述也会抓取
在\scaffolds\post.md中添加如下代码,用于生成的文章中添加关键词和描述:
12keywords: description:
将以下代码去掉:
1234567{% if post.description %} {{ post.description }} <div class="post-more-link text-center"> <a class="btn" h
...
hexo的seo优化之nofollow
优化nofollow给非友情链接的出站链接添加 “nofollow” 标签,nofollow标签是由谷歌领头创新的一个“反垃圾链接”的标签,并被百度、yahoo等各大搜索引擎广泛支持,引用nofollow标签的目的是:用于指示搜索引擎不要追踪(即抓取)网页上的带有nofollow属性的任何出站链接,以减少垃圾链接的分散网站权重。
找到themes\next\layout_partials\footer.swig文件的:
1{{ __('footer.powered', '<a class="theme-link"
...
hexo某些功能,配置引用的文章
搭建博客https://www.cnblogs.com/visugar/p/6821777.html
https://segmentfault.com/a/1190000017986794
https://blog.csdn.net/sinat_37781304/article/details/82729029
https://blog.csdn.net/sinat_37781304/article/details/82729029
https://blog.csdn.net/baidu_35145586/article/details/89033631
播放器[URL](Hexo NexT
...
hexo首页文章预显示设置
预显示设置使用<!-more->手动截断在文章中的front-matter中添加description,并提供文章摘录。这种方式只会在首页列表中显示文章的摘要内容,进入文章详情后不会再显示。在文章的 front-matter 中添加 description 和 photos 字段,如下图所示。如果不需要显示图片的话,可以把 photos 去掉。
自动形成摘录在主题配置文件_config.yml中auto_excerpt