We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59f60d2 commit e14c3f3Copy full SHA for e14c3f3
lib/rel.js
@@ -7,7 +7,8 @@ function relSitemapInject(data) {
7
8
if (!rel || data.match(/rel=['|"]?sitemap['|"]?/i)) return;
9
10
- const relSitemap = `<link rel="sitemap" type="application/xml" title="Sitemap" href="${url_for.call(this, path)}">`;
+ const relPath = typeof path === 'string' ? path : path[0];
11
+ const relSitemap = `<link rel="sitemap" type="application/xml" title="Sitemap" href="${url_for.call(this, relPath)}">`;
12
13
return data.replace(/<head>(?!<\/head>).+?<\/head>/s, str => str.replace('</head>', `${relSitemap}</head>`));
14
}
0 commit comments