onNavigate(source) {
      const { auto2top, topMargin } = this.config;
      const { path, query } = this.route;

      this.#markSidebarActiveElm();

      // Note: Scroll position set by browser on forward/back (i.e. "history")
      if (source !== 'history') {
        // Anchor link
        if (query.id) {
          const headingElm = dom.find(
            `.markdown-section :where(h1, h2, h3, h4, h5)[id="${query.id}"]`,
          );

          if (headingElm) {
            this.#watchNextScroll();
            headingElm.scrollIntoView({
              behavior: 'smooth',
              block: 'start',
            });
          }
        }
        // User click/tap
        else if (source === 'navigate') {
          // Scroll to top
          if (auto2top) {
            document.scrollingElement.scrollTop = topMargin ?? 0;
          }
        }
      }

      // Clicked anchor link
      if (path === '/' || (query.id && source === 'navigate')) {
        isMobile() && this.#toggleSidebar(false);
      }

      // Clicked anchor link or page load with anchor ID
      if (query.id || source === 'navigate') {
        this.#focusContent();
      }
    }
Handle navigation events

@param {undefined|"history"|"navigate"} source Type of navigation where
undefined is initial load, "history" is forward/back, and "navigate" is
user click/tap
@void