[DOCS] Fix docs preview workflow URL generation logic (#129608)

This commit is contained in:
Liam Thompson 2025-06-18 11:20:49 +02:00 committed by GitHub
parent 796d65952c
commit f62fce9ae9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -35,8 +35,8 @@ jobs:
!/(^|\/)_snippets\//i.test(f.filename)
)
.map(f => {
let p = f.filename.replace(/\/index\.md$/i, '/');
if (p === f.filename) p = p.replace(/\.md$/i, '');
let p = f.filename.replace(/^docs\//, '').replace(/\/index\.md$/i, '/');
if (p === f.filename.replace(/^docs\//, '')) p = p.replace(/\.md$/i, '');
return `- [\`${f.filename}\`](${base}/${p})`;
});
if (!links.length) return; // nothing to do
@ -68,4 +68,4 @@ jobs:
issue_number: prNum,
body
});
}
}