Skip to content

Commit

Permalink
fix: link to doc, replace dashes with undescores
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcAntoine-Arnaud committed Sep 2, 2024
1 parent 6ba3782 commit 9f2a583
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webapp/crate.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@ <h3 class="mb-3 text-2xl font-bold text-gray-900 dark:text-white">Remove this ow
document.getElementById("meta-uploaded-by").href = `mailto:${currentVersion.uploadedBy.email}`;
document.getElementById("meta-install").appendChild(document.createTextNode(`${currentVersion.index.name} = { version = "${currentVersion.index.vers}", registry = "${regName}" }`));
if (currentVersion.hasDocs) {
const crateRustName = currentVersion.index.name.replaceAll("-", "_");
const link = document.createElement("a");
link.appendChild(document.createTextNode(`v${currentVersion.index.vers}`));
link.setAttribute("href", `/docs/${currentVersion.index.name}/${currentVersion.index.vers}/${currentVersion.index.name}/index.html`);
link.setAttribute("href", `/docs/${currentVersion.index.name}/${currentVersion.index.vers}/${crateRustName}/index.html`);
document.getElementById("meta-docs").appendChild(link);
} else {
// TODO: add regen button here
Expand Down

0 comments on commit 9f2a583

Please sign in to comment.