Skip to content

Commit

Permalink
Allow sitemap.additionalUrl configuration to be an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ludoviclefevrehubstairs committed Dec 21, 2020
1 parent cb9b60a commit 13ac9f4
Show file tree
Hide file tree
Showing 2 changed files with 3,403 additions and 2,836 deletions.
23 changes: 16 additions & 7 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ const seoFriendlySitemap = function(locals) {
sitemaps = _.concat(posts.get(), pages.get(), categories.get(), tags.get(), xsl.get())

if (config.sitemap.additionalUrl) {
sitemaps.push(
Promise.resolve({
filename: config.sitemap.additionalUrl.filename,
lastModification: config.sitemap.additionalUrl.lastModification,
isInIndexSitemap: true
})
)
if(_.isArray(config.sitemap.additionalUrl)) {
_.each(config.sitemap.additionalUrl, sitemap=>{
sitemaps.push(Promise.resolve({
filename: sitemap.filename,
lastModification: sitemap.lastModification,
isInIndexSitemap: true
}))})
} else {
sitemaps.push(
Promise.resolve({
filename: config.sitemap.additionalUrl.filename,
lastModification: config.sitemap.additionalUrl.lastModification,
isInIndexSitemap: true
})
)
}
}

return Promise.all(sitemaps)
Expand Down
Loading

0 comments on commit 13ac9f4

Please # to comment.