@@ -40,6 +40,11 @@ const Wiki = sites => {
40 ? 'selected'
40 ? 'selected'
43+ const randomTerm = () => {
44+ const keys = Object.keys(entries)
45+ return keys[Math.floor(Math.random() * keys.length)]
43 const formatSideBarCat = (key, entries) => (currentHtml, cat) => {
48 const formatSideBarCat = (key, entries) => (currentHtml, cat) => {
44 const catLength = Object.keys(entries[cat]).length
49 const catLength = Object.keys(entries[cat]).length
45 const newHtml = `<li class='${selected(key, cat)}'}'>
50 const newHtml = `<li class='${selected(key, cat)}'}'>
@@ -98,7 +103,7 @@ const Wiki = sites => {
99 main.innerHTML = `<div class='related'><h1>${key}</h1>${relatedHtml}</div>${items}`
104 main.innerHTML = `<div class='related'><h1>${key}</h1>${relatedHtml}</div>${items}`
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>`
102 const stats = `The wiki contains ${terms.size} terms in ${Object.keys(entries).length} categories, from ${authors.size} authors.`
107 const stats = `The wiki contains ${terms.size} terms in ${Object.keys(entries).length} categories, from ${authors.size} authors.`
103 main.innerHTML = `${html}<br />${stats}`
108 main.innerHTML = `${html}<br />${stats}`