Open rich-tweed opened 5 years ago
On the Sitemap Protocol Specification it is stated that these fields are optional.
In this library, the fields are being populated if they are not present at the moment the XML is created
Inside github.com/ikeikeikeike/go-sitemap-generator/v2/stm/builder_url.go
if _, ok := SetBuilderElementValue(url, su.data, "changefreq"); !ok {
changefreq := url.CreateElement("changefreq")
changefreq.SetText("weekly")
}
if _, ok := SetBuilderElementValue(url, su.data, "priority"); !ok {
priority := url.CreateElement("priority")
priority.SetText("0.5")
}
Not really sure why this is the current behaviour.
There's a PR #33 that addresses this and has a few more resources showing that these fields could be ignored. Not sure how is the approval handled. @ikeikeikeike are you in charge of accepting the contributions? Just asking because the PR is from 2019 🤓
Hi @ikeikeikeike ,
Any updates on this one?
When I create sitemaps using this repo is seems like "changefreq" and "priority" tags are being added, with default values of "weekly" and "0.5" respectively.
How can I unset them or create a sitemap without these tags?