给博客添加网站地图sitemap 🗺

搜索引擎每天让蜘蛛在网站爬行来抓取页面,网站地图的作用就是给主动给蜘蛛喂数据,网站地图位于网站根目录下,有sitemap.html和sitemap.xml两种格式。百度搜索引擎及多数搜索引擎使用html格式,谷歌使用xml格式。

1、安装网站地图生成插件

npm install hexo-generator-sitemap --save #sitemap.xml适合提交给谷歌搜素引擎
npm install hexo-generator-baidu-sitemap --save #baidusitemap.xml适合提交百度搜索引擎

2、在站点配置文件_config.yml中添加或修改以下代码🖧

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://你的网站

3、修改文章🕮链接显示方式

打开博客根目录下的_config.yml,找到URL的配置项并修改

url: https://yangping.xyz
# 修改 permalink 让你的文章链接更加友好,并且有益于 SEO
# permalink: ':year/:month/:day/:title/'
permalink: :year:month:day:hash.html

参考:
[hexo之icarus主题的美化修改以及简单的SEO配置_珂泽的博客-CSDN博客_icarus修改].https://blog.csdn.net/qq_41793001/article/details/103055201?spm=1001.2101.3001.4242.1&utm_relevant_index=2)

给博客添加网站地图sitemap 🗺

https://yangping.xyz/20230102e07f110e332a.html

作者

洋平

发布于

2023-01-02

更新于

2023-01-15

许可协议

评论

You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×