Fix id collision between commands placeholder and section heading

Zola auto-generates id="available-commands" on the "Available commands"
<h2>. The placeholder <p> shared that id, so getElementById matched the
heading first and the populate-from-WASM_COMMANDS script ended up
overwriting the heading text — rendering the command list at h2 size.
Rename the placeholder to a non-colliding id.
This commit is contained in:
Sylvestre Ledru
2026-05-13 08:43:16 +02:00
parent bf07dc3dc3
commit 27435ba3dc
+2 -2
View File
@@ -37,7 +37,7 @@ template = "page.html"
} }
// Populate the "Available commands" list from the build-generated list // Populate the "Available commands" list from the build-generated list
if (typeof WASM_COMMANDS !== "undefined" && Array.isArray(WASM_COMMANDS)) { if (typeof WASM_COMMANDS !== "undefined" && Array.isArray(WASM_COMMANDS)) {
var listEl = document.getElementById("available-commands"); var listEl = document.getElementById("wasm-commands-list");
if (listEl) { if (listEl) {
listEl.innerHTML = WASM_COMMANDS.slice().sort().map(function(c) { listEl.innerHTML = WASM_COMMANDS.slice().sort().map(function(c) {
return "<code>" + c + "</code>"; return "<code>" + c + "</code>";
@@ -113,7 +113,7 @@ Multiple commands can be separated by newlines (`%0A` in the URL):
The following commands run as **real Rust coreutils compiled to WebAssembly**: The following commands run as **real Rust coreutils compiled to WebAssembly**:
<p id="available-commands">Loading the list of available commands…</p> <p id="wasm-commands-list">Loading the list of available commands…</p>
The following are **shell builtins** implemented in JavaScript: The following are **shell builtins** implemented in JavaScript: