X-Git-Url: https://git.ladys.computer/x_status_git/blobdiff_plain/3394dfeb4194ca630becdb4d34538a3370d47ca8..a5da9db50960213ba706932818b2f4fc7c347cde:/topic.html diff --git a/topic.html b/topic.html index 3a08a13..f0a4a9e 100644 --- a/topic.html +++ b/topic.html @@ -10,12 +10,6 @@ body{ Display: Grid; Box-Sizing: Border-Box; Margin: Auto; Padding-Inline: 1REM; const nav = document.body.querySelector("nav") const dl = nav.querySelector("dl") const parser = new DOMParser -if (location.pathname.startsWith("/topics/")) { - const a = nav - .insertBefore(document.createElement("p"), dl) - .appendChild(document.createElement("a")) - a.href = "/topics/" - a.textContent = "Topics" } fetch(`${location}.jsonld`) .then($ => $.json()) .then(meta => { @@ -24,6 +18,12 @@ fetch(`${location}.jsonld`) document.body.querySelector("h1").textContent = "subject" in meta ? `#${topic}` : `@${topic}` + if ("subject" in meta) { + const a = nav + .insertBefore(document.createElement("p"), dl) + .appendChild(document.createElement("a")) + a.href = "/topics" + a.textContent = "Topics" } const { first, prev, next, current, items } = meta if (first && first != location && first != prev) { const a = nav