Skip to content

Commit 1825f4f

Browse files
committed
Fix vicutil's paths
1 parent f4d2f31 commit 1825f4f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -703,20 +703,22 @@ <h2 id="problems-title"></h2>
703703
else if (problem.type === 'util-script') icon = '🛠️';
704704
else icon = '💻';
705705

706+
const displayPath = platform === 'vicutils' ? problem.name : `${platform}/${problem.name}`;
707+
706708
item.innerHTML = `
707709
<div class="problem-name">
708710
<span class="problem-type-icon">${icon}</span>
709711
${problem.displayName}
710712
</div>
711-
<div class="problem-path">${platform}/${problem.name}</div>
713+
<div class="problem-path">${displayPath}</div>
712714
`;
713715

714-
if (problem.hasHtml && problem.htmlFiles.length > 0) {
715-
if (platform === 'vicutils') {
716-
item.onclick = () => window.location.href = `${platform}/${problem.name}`;
717-
} else {
718-
item.onclick = () => window.location.href = `${platform}/${problem.name}/${problem.htmlFiles[0].name}`;
719-
}
716+
if (platform === 'vicutils') {
717+
// For vicutils, link directly to the HTML file
718+
item.onclick = () => window.location.href = `${platform}/${problem.name}`;
719+
} else if (problem.hasHtml && problem.htmlFiles.length > 0) {
720+
// For leetcode and kattis, maintain the subfolder structure
721+
item.onclick = () => window.location.href = `${platform}/${problem.name}/${problem.htmlFiles[0].name}`;
720722
} else {
721723
item.onclick = () => generatePage(platform, problem);
722724
}

0 commit comments

Comments
 (0)