index redirect

This commit is contained in:
Garry Ing
2021-03-28 19:11:31 -04:00
parent 749cdc7160
commit 6f650f390a
3 changed files with 15 additions and 40 deletions

View File

@ -112,6 +112,14 @@ const setupListeners = (linkElement) => {
document.querySelectorAll('#notes-entry-container a').forEach(setupListeners)
// Random note index
if (typeof window.graphDataIndex !== 'undefined') {
const indexNodes = window.graphDataIndex.nodes
const randomNode = indexNodes[Math.floor(Math.random() * indexNodes.length)]
window.location = randomNode.path
}
// Notes graph
const d3 = window.d3