statonjr / middleman-sitemap

A Middleman extension to create a sitemap for your Middleman site
MIT License
22 stars 18 forks source link

Trailing slash missing in URLs #7

Open ABrisset opened 8 years ago

ABrisset commented 8 years ago

When sitemap is build, each URL misses the trailing slash, i.e /. That leads to 301 redirects to URL with trailing slash, which is not optimal for SEO. Could you automatically add this trailing slash ? Thanks !

shaunakv1 commented 8 years ago

Running into same problem here due to removal of trailing slashes. Seems like the trailing slashes are being specifically removed as can be seen in this line:

https://github.com/statonjr/middleman-sitemap/blob/master/templates/sitemap.xml.erb#L5

I am just going to download the extension and remove the code .gsub(/\/$/,'') from it, however it will be nice to have this as a configuration option in the extension. I will submit a pull request if I get around to implementing it.