Will's Digital Garden

Simple SNUB Helper

I've added a small piece of JS to this site that looks for SNUB-style relations, then presents a list of links to those original articles for convenience. It's not very pretty or robust, but sometimes that's okay!

Here it is, if you'd like to add this to your site too:

let links = []
document.querySelectorAll('[rel="snub:reply"]').forEach((e) => { links.push(e) })

let div = document.createElement("div")
div.style = "position: absolute; top: 0; right: 0"

links.forEach((element) => {
  let a = document.createElement("a")
  a.href = element.href
  a.style = "padding: 1em; margin: 1em; background: rgba(0,0,0,0.1); border-radius: 0.5em; display: inline-block"
  a.innerHTML = element.href
  div.appendChild(a)
})

document.querySelector('body').appendChild(div)