Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create sitemap without "changefreq" or "priority" #34

Open
rich-tweed opened this issue Nov 8, 2019 · 2 comments
Open

How to create sitemap without "changefreq" or "priority" #34

rich-tweed opened this issue Nov 8, 2019 · 2 comments

Comments

@rich-tweed
Copy link

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?

@eduardohoraciosanto
Copy link

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 🤓

@ammark100
Copy link

Hi @ikeikeikeike ,

Any updates on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants