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 => {
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