ikeikeikeike / go-sitemap-generator

go-sitemap-generator is the easiest way to generate Sitemaps in Go
https://github.com/ikeikeikeike/go-sitemap-generator
MIT License
218 stars 65 forks source link

Format sitemap XML #11

Closed kaihendry closed 7 years ago

kaihendry commented 7 years ago

I noticed by default the XML sitemap is just one long line. Therefore when diagnosing issues in https://www.google.com/webmasters/tools it only gives that line number as to an indicator to where my problem is:

My workaround is to use xmlstarlet fo sitemap1.xml > sitemap-formatted.xml so that the line numbers a sitemap test returns are useful. So I was thinking maybe stm could just pretty print the XML to begin with?

ikeikeikeike commented 7 years ago

hi You mean, it allows pretty formatting to all of output xml to begin with, by option like a sm.SetPretty(true) method ?"

kaihendry commented 7 years ago

Yes, exactly! So that when Google flags an issue on a line number it's easier to track down the problem.

ikeikeikeike commented 7 years ago

Respond by #12