Github 的 jekyll 站点地图生成器给出了错误的空格 url
Github's jekyll sitemap generator giving wrong urls for spaces
我页面的其中一个网址是:
http://blog.theofekfoundation.org/general%20computer%20programming/2015/12/30/2d-array-copy-speeds.html
(note the %20s)
虽然 jekyll 站点地图条目是:
<loc>
http://blog.theofekfoundation.org/general%2520computer%2520programming/2015/12/30/2d-array-copy-speeds.html
</loc> # Note the %2520s
我使用 github 的站点地图添加了站点地图 gem:
gems:
- jekyll-sitemap
在我的 _config.yml.
知道出了什么问题或如何解决吗?
目前,jekyll-sitemap
总是对 URL 进行编码,并且不够智能,无法检测到 URL 已经包含编码文本,这导致它对 %
字符(因此 %25
)。
您可以 open an issue 在 jekyll-sitemap
存储库上,看看是否有任何改进这个故事的计划。
但是,如果可以的话,我建议您不要使用空格,而是使用破折号 -
,这样更加人性化且更易于阅读...还有额外的好处它不会破坏站点地图。
此外,去掉末尾的 .html。
例如
http://blog.theofekfoundation.org/general-computer-programming/2015/12/30/2d-array-copy-speeds/
我页面的其中一个网址是:
http://blog.theofekfoundation.org/general%20computer%20programming/2015/12/30/2d-array-copy-speeds.html (note the %20s)
虽然 jekyll 站点地图条目是:
<loc>
http://blog.theofekfoundation.org/general%2520computer%2520programming/2015/12/30/2d-array-copy-speeds.html
</loc> # Note the %2520s
我使用 github 的站点地图添加了站点地图 gem:
gems:
- jekyll-sitemap
在我的 _config.yml.
知道出了什么问题或如何解决吗?
目前,jekyll-sitemap
总是对 URL 进行编码,并且不够智能,无法检测到 URL 已经包含编码文本,这导致它对 %
字符(因此 %25
)。
您可以 open an issue 在 jekyll-sitemap
存储库上,看看是否有任何改进这个故事的计划。
但是,如果可以的话,我建议您不要使用空格,而是使用破折号 -
,这样更加人性化且更易于阅读...还有额外的好处它不会破坏站点地图。
此外,去掉末尾的 .html。
例如 http://blog.theofekfoundation.org/general-computer-programming/2015/12/30/2d-array-copy-speeds/