Skip to content

Commit bc61270

Browse files
committed
fix: disable non functional server mode on gh
1 parent 9e58aa5 commit bc61270

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

templates/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,17 @@ <h4>Recommendations for Clean Code</h4>
645645

646646
// Initialize WASM on page load
647647
window.addEventListener('load', async () => {
648+
// Check if running on GitHub Pages
649+
const isGitHubPages = window.location.hostname.includes('github.io');
650+
651+
// Disable server option if on GitHub Pages
652+
if (isGitHubPages) {
653+
const modeSelect = document.getElementById('modeSelect');
654+
const serverOption = modeSelect.querySelector('option[value="server"]');
655+
serverOption.disabled = true;
656+
serverOption.text = 'Server (Disabled on GitHub Pages)';
657+
}
658+
648659
await initWasm();
649660
await showCode('simple');
650661
});

0 commit comments

Comments
 (0)