Skip to content

Commit

Permalink
only show change frequency if set (google doesn't like it)
Browse files Browse the repository at this point in the history
  • Loading branch information
galvogalvo committed Dec 15, 2021
1 parent c3fd436 commit d9fb108
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SitemapStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ module.exports = function SitemapStream(options) {
stream.write(`\n <xhtml:link rel='alternate' hreflang='` + alternativeUrl.lang +
`' href='` + escapeUnsafe(alternativeUrl.url) + `' />`);
}
stream.write(`\n <changefreq>` + options.changeFreq + `</changefreq>`);
if(options.changeFreq){
stream.write(`\n <changefreq>` + options.changeFreq + `</changefreq>`);
}
stream.write(`\n <priority>` + getPiriorityFromDepth(queueItem.depth) + `</priority>`);
stream.write(`\n <lastmod>` + queueItem.lastMod + `</lastmod>`);
stream.write(`\n </url>`);
Expand Down

0 comments on commit d9fb108

Please sign in to comment.