首页 > hexo-generator-sitemap 生成的sitemap如何配置自定义的域名?

hexo-generator-sitemap 生成的sitemap如何配置自定义的域名?

我用hexo-generator-sitemap生成博客的sitemap,可是sitemap.xml里面的地址前缀都是:http://XXX.github.io/ 这样的,如何配置才能修改成自己的域名


没有太看明白你问题的意思。但是你可以参考一下我的设置。我本人用的是NexT的主题,设置sitemap.xml步骤基本如下:

1.安装插件:

npm install hexo-generator-sitemap --save 
npm install hexo-generator-baidu-sitemap --save 

2.在站点下的_config.yml文件中添加下面的内容:

# Sitemap Setting
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml

3.在robots.txt文件中添加以下内容(注意把域名换成你自己的):

Sitemap: http://dkylin.com/sitemap.xml
Sitemap: http://dkylin.com/baidusitemap.xml

4.robots.txt是蜘蛛协议,给搜索引擎爬的,可以参考下面的文件:

# hexo robots.txt
User-agent: *
Allow: /
Allow: /archives/ 

Disallow: /js/
Disallow: /css/
Disallow: /fonts/
Disallow: /vendors/
Disallow: /fancybox/

Sitemap: http://dkylin.com/sitemap.xml
Sitemap: http://dkylin.com/baidusitemap.xml

手动创建文件,将其放在站点目录下的source目录下即可。


修改_config.yml文件

    # URL
    ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
    url:  http://www.tiexo.cn
    

将url改为自定义域名


同问啊,看了下源码,貌似也没有这个设置的字段!不知道楼主解决了没有。。。。

【热门文章】
【热门文章】