Move Hierarchy List Before Linked References

  • Add the following code into file custom.js (create inside folder logseq if missing):
    const hrchy = document.getElementsByClassName("page-hierarchy");
    const hrchyObserver = new MutationObserver(function onMutated(){
        if (hrchy.length < 1) return
    
        const div = hrchy[0]
        if (div.dataset.initialized) return
    
        const refs = document.querySelector('div:has(> .lazy-visibility .references.page-linked)')
        if (!refs) return
    
        refs.before(div)
        div.dataset.initialized = "true"
    });
    hrchyObserver.observe(document.getElementById("main-content-container"), {
        childList: true, subtree: true
    });
    
  • Restart Logseq and accept the warning.