@@ -40,6 +40,11 @@ const Wiki = sites => {
4040 ? 'selected'
4141 : ''
4242
43+ const randomTerm = () => {
44+ const keys = Object.keys(entries)
45+ return keys[Math.floor(Math.random() * keys.length)]
46+ }
47+
4348 const formatSideBarCat = (key, entries) => (currentHtml, cat) => {
4449 const catLength = Object.keys(entries[cat]).length
4550 const newHtml = `<li class='${selected(key, cat)}'}'>
@@ -98,7 +103,7 @@ const Wiki = sites => {
98103 : ''
99104 main.innerHTML = `<div class='related'><h1>${key}</h1>${relatedHtml}</div>${items}`
100105 } else {
101− const html = `Click a /topic to get started, or try a random page`
106+ const html = `Click a /topic to get started, or try a <a href='#${randomTerm()}'>random page</a>`
102107 const stats = `The wiki contains ${terms.size} terms in ${Object.keys(entries).length} categories, from ${authors.size} authors.`
103108 main.innerHTML = `${html}<br />${stats}`
104109 }