]> Lady’s Gitweb - x_status_git/blobdiff - topic.html
Support lookup by identifier
[x_status_git] / topic.html
index 3a08a135ba5a10df19d03074871fc947c5f3b3b0..f0a4a9ef955c9ffc19082f44c69a7d8bb593645f 100644 (file)
@@ -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
This page took 0.091155 seconds and 4 git commands to generate.