Skip to content

Commit

Permalink
Merge pull request #317 from iamvishnusankar/fix-trailing-slash-xml
Browse files Browse the repository at this point in the history
[Fix] <trailingSlash>true</trailingSlash> found in the sitemap.xml
  • Loading branch information
iamvishnusankar committed Mar 2, 2022
2 parents 256f1c5 + 06f62e9 commit d947e01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next-sitemap/src/sitemap/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export const buildSitemapXml = (fields: ISitemapField[]): string => {

// Iterate all object keys and key value pair to field-set
for (const key of Object.keys(fieldData)) {
// Skip reserved keys
if (['trailingSlash'].includes(key)) {
continue
}

if (fieldData[key]) {
if (key !== 'alternateRefs') {
field.push(`<${key}>${fieldData[key]}</${key}>`)
Expand Down

0 comments on commit d947e01

Please sign in to comment.