Skip to content

Commit

Permalink
fix: missing warning on generate mode
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoPennec committed Apr 23, 2020
1 parent 56d586b commit d82ee3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/generator.js
Expand Up @@ -18,6 +18,12 @@ const { excludeRoutes } = require('./routes')
* @param {number} depth
*/
async function generateSitemaps(options, globalCache, nuxtInstance, depth = 0) {
/* istanbul ignore if */
if (depth > 1) {
// see https://webmasters.stackexchange.com/questions/18243/can-a-sitemap-index-contain-other-sitemap-indexes
logger.warn("A sitemap index file can't list other sitemap index files, but only sitemap files")
}

const isSitemapIndex = options && options.sitemaps && Array.isArray(options.sitemaps) && options.sitemaps.length > 0

if (isSitemapIndex) {
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware.js
Expand Up @@ -18,9 +18,9 @@ const { excludeRoutes } = require('./routes')
* @param {number} depth
*/
function registerSitemaps(options, globalCache, nuxtInstance, depth = 0) {
/* istanbul ignore if */
if (depth > 1) {
// see https://webmasters.stackexchange.com/questions/18243/can-a-sitemap-index-contain-other-sitemap-indexes
/* istanbul ignore next */
logger.warn("A sitemap index file can't list other sitemap index files, but only sitemap files")
}

Expand Down

0 comments on commit d82ee3e

Please sign in to comment.