From 5f1ec57c9e9f04c73f63874a00a77e3cb96d088f Mon Sep 17 00:00:00 2001 From: lsy Date: Mon, 19 May 2025 14:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96sitemap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/sitemap-integration.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/sitemap-integration.js b/src/plugins/sitemap-integration.js index df34fcb..40d938b 100644 --- a/src/plugins/sitemap-integration.js +++ b/src/plugins/sitemap-integration.js @@ -125,11 +125,12 @@ function generateXsltStylesheet(entries) { border-collapse: collapse; margin-top: 20px; min-width: 100%; + border: 1px solid var(--border); } .table th, .table td { padding: 10px; - border-bottom: 1px solid var(--border); + border: 1px solid var(--border); text-align: left; white-space: nowrap; /* 防止URL换行 */ } @@ -339,7 +340,6 @@ export function customSitemapIntegration() { buildDirPath = String(dir); } - console.log(`构建目录路径: ${buildDirPath}`); // 收集所有页面信息 const sitemapEntries = []; @@ -360,16 +360,16 @@ export function customSitemapIntegration() { // 确定页面优先级 let priority = 0.7; - // 首页最高优先级 - if (page.pathname === '/') { + // 首页最高优先级 - 增强匹配逻辑 + if (page.pathname === '/' || urlObj.pathname === '/' || decodedPathname === '/') { priority = 1.0; } // 文章列表页次高优先级 - else if (page.pathname === '/articles/') { + else if (page.pathname === '/articles/' || decodedPathname === '/articles/') { priority = 0.9; } // 文章页面 - else if (page.pathname.includes('/articles/')) { + else if (page.pathname.startsWith('/articles/') || decodedPathname.startsWith('/articles/')) { priority = 0.8; }