From e14c3f32e09e11a7a3da1930b2b1735e318ba2fe Mon Sep 17 00:00:00 2001 From: uiolee <22849383+uiolee@users.noreply.github.com> Date: Thu, 6 Apr 2023 20:51:15 +0800 Subject: [PATCH] fix(rel): fix bug causes by sitemap.txt --- lib/rel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rel.js b/lib/rel.js index 0ca10dc..3ee6a3e 100644 --- a/lib/rel.js +++ b/lib/rel.js @@ -7,7 +7,8 @@ function relSitemapInject(data) { if (!rel || data.match(/rel=['|"]?sitemap['|"]?/i)) return; - const relSitemap = ``; + const relPath = typeof path === 'string' ? path : path[0]; + const relSitemap = ``; return data.replace(/(?!<\/head>).+?<\/head>/s, str => str.replace('', `${relSitemap}`)); }