Spaces:
Running
Running
Deploy the website
Browse files- js/main.js +2 -2
js/main.js
CHANGED
|
@@ -14,13 +14,13 @@ const nav = document.getElementById("nav");
|
|
| 14 |
function renderNav(path) {
|
| 15 |
const link = (href, text, active, cls) =>
|
| 16 |
h("a", { href, class: cls, target: cls === "ext" ? "_blank" : null, rel: cls === "ext" ? "noopener" : null, "aria-current": active ? "page" : null }, text);
|
| 17 |
-
nav.replaceChildren(
|
| 18 |
link("#/", "Overview", path === "/", "home"),
|
| 19 |
link("#/tasks", "Tasks", path === "/tasks" || path.startsWith("/t/")),
|
| 20 |
link("#/methods", "Methods", path === "/methods"),
|
| 21 |
link(`https://huggingface.co/datasets/${RESULTS}`, "Data", false, "ext"),
|
| 22 |
GITHUB ? link(GITHUB, "Tasks repo", false, "ext") : null,
|
| 23 |
-
);
|
| 24 |
}
|
| 25 |
|
| 26 |
let lastPath = null;
|
|
|
|
| 14 |
function renderNav(path) {
|
| 15 |
const link = (href, text, active, cls) =>
|
| 16 |
h("a", { href, class: cls, target: cls === "ext" ? "_blank" : null, rel: cls === "ext" ? "noopener" : null, "aria-current": active ? "page" : null }, text);
|
| 17 |
+
nav.replaceChildren(...[
|
| 18 |
link("#/", "Overview", path === "/", "home"),
|
| 19 |
link("#/tasks", "Tasks", path === "/tasks" || path.startsWith("/t/")),
|
| 20 |
link("#/methods", "Methods", path === "/methods"),
|
| 21 |
link(`https://huggingface.co/datasets/${RESULTS}`, "Data", false, "ext"),
|
| 22 |
GITHUB ? link(GITHUB, "Tasks repo", false, "ext") : null,
|
| 23 |
+
].filter(Boolean)); // replaceChildren would show a null as text
|
| 24 |
}
|
| 25 |
|
| 26 |
let lastPath = null;
|