Skip to content

Commit 78aca78

Browse files
committed
redirect icons fix
1 parent fb72685 commit 78aca78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.hugo/layouts/partials/hooks/body-end.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@
9696
links.forEach(link => {
9797
if (!link.name || !link.url) return;
9898

99-
let finalUrl = (link.isRight ? link.redirect : link.url).replace(/\/+/g, '/');
99+
let rawUrl = link.isRight ? link.redirect : link.url;
100+
// Only strip double slashes if it is an internal relative link
101+
let finalUrl = rawUrl.startsWith('http') ? rawUrl : rawUrl.replace(/\/+/g, '/');
100102

101103
// Apply active version prefix mapping
102104
if (!link.isRight && activePrefix !== '/' && !finalUrl.startsWith(activePrefix)) {

0 commit comments

Comments
 (0)