diff --git a/src/assets/sitemapper.js b/src/assets/sitemapper.js index 9b32939..e873d73 100644 --- a/src/assets/sitemapper.js +++ b/src/assets/sitemapper.js @@ -331,7 +331,7 @@ export default class Sitemapper { } else { let fields = {}; for (const [field, active] of Object.entries(this.fields)) { - if(active){ + if(active && site[field]){ fields[field] = site[field][0] } } diff --git a/src/tests/test.ts.ts b/src/tests/test.ts.ts index 34185bb..680a6bf 100644 --- a/src/tests/test.ts.ts +++ b/src/tests/test.ts.ts @@ -119,9 +119,9 @@ describe('Sitemapper', function () { }); }); - it('https://www.channable.com/sitemap.xml sitemaps should contain extra fields', function (done) { + it('https://wp.seantburke.com/sitemap.xml sitemaps should contain extra fields', function (done) { this.timeout(30000); - const url = 'https://www.channable.com/sitemap.xml'; + const url = 'https://wp.seantburke.com/sitemap.xml'; sitemapper = new Sitemapper({ fields: { "loc": true, "lastmod": true,