Skip to content

Commit

Permalink
Add index.html to doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
iahmadgad committed Sep 13, 2024
1 parent 23c0a44 commit a49d20f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
run: cargo clean --doc
- name: Build docs
run: cargo doc --no-deps
- name: Add redirect
run: echo '<meta http-equiv="refresh" content="0;url=aoc/index.html">' > target/doc/index.html
- name: Add index.html page
run: cp docs/index.html target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
- name: Upload artifact
Expand Down
33 changes: 33 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🦀 Rust Randoms</title>
<script src="crates.js"></script> <!-- Include the data.js file -->
<script>
function generateList() {
const listContainer = document.getElementById('crates');
window.ALL_CRATES.forEach(item => {
listItem = document.createElement('li');
link = document.createElement('a');
link.href = `/${item}`;
link.textContent = item;
listItem.appendChild(link);
listContainer.appendChild(listItem);
});
}

window.onload = generateList;
</script>
</head>
<body style="background-color:dimgrey; color:white">
<tt>
<h1>🦀 Rust Randoms</h1>
<p>📦 Crates: </p>
<ul id="crates">
<!-- List will be generated here -->
</ul>
</tt>
</body>
</html>

0 comments on commit a49d20f

Please sign in to comment.