No description
Find a file
Narath Carlile fd4fb4c52b fix: scroll only the explorer container, not the whole window
On page load the explorer reveals the active item with
`activeElement.scrollIntoView({ behavior: "smooth" })`. `scrollIntoView`
scrolls *every* scrollable ancestor, including the document, so when SPA
routing is disabled (each navigation is a full page load) the window gets
dragged down to wherever the active item sits in the sidebar — the reader
lands partway down the new page instead of at the top.

Use `explorerUl.scrollTo(...)`, which only moves the explorer's own scroll
container, to center the active item without ever scrolling the window.
The smooth animation is preserved.
2026-07-09 11:50:23 -04:00
.github/workflows build: bundle dependencies and ship pre-built dist 2026-04-27 21:37:51 +02:00
dist chore(deps): update @quartz-community/utils 2026-06-03 15:27:42 +02:00
src fix: scroll only the explorer container, not the whole window 2026-07-09 11:50:23 -04:00
test fix: resolve ESLint and formatting issues for CI compliance 2026-03-09 03:47:39 +01:00
types fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.eslintrc.json fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.gitignore chore: commit dist/ and remove prepare script 2026-03-14 21:58:29 +01:00
.prettierignore fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.prettierrc Initial commit 2026-02-07 02:03:54 +01:00
CHANGELOG.md Initial commit 2026-02-07 02:03:54 +01:00
LICENSE Initial commit 2026-02-07 02:03:54 +01:00
package-lock.json chore(deps): update @quartz-community/utils 2026-06-03 15:27:42 +02:00
package.json chore: remove vestigial @jackyzha0/quartz peerDependency 2026-05-24 16:24:00 +02:00
README.md docs: update README for v5 unified config system 2026-02-25 16:07:11 +01:00
tsconfig.build.json fix: use separate tsconfig for DTS build to avoid vitest dependency 2026-03-22 13:12:01 +01:00
tsconfig.json fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
tsup.config.ts build: bundle dependencies and ship pre-built dist 2026-04-27 21:37:51 +02:00
vitest.config.ts fix: explorer not loading 2026-02-09 20:24:35 +01:00

@quartz-community/explorer

The Explorer component for Quartz - navigate your digital garden with an interactive file tree.

Features

  • 📁 Interactive folder tree with collapse/expand functionality
  • 📱 Mobile-friendly slide-out navigation
  • 💾 Persistent state (remembers open/closed folders)
  • 🔗 Configurable folder click behavior (link or collapse)
  • Built-in search and overflow handling

Installation

npx quartz plugin add github:quartz-community/explorer

Usage

plugins:
  - source: github:quartz-community/explorer
    enabled: true
    layout:
      position: left
      priority: 50

For advanced use cases, you can override in TypeScript:

import * as ExternalPlugin from "./.quartz/plugins";

ExternalPlugin.Explorer({
  title: "Explorer",
  folderDefaultState: "collapsed",
  folderClickBehavior: "link",
  useSavedState: true,
});

Configuration Options

interface ExplorerOptions {
  /** Title displayed above the explorer */
  title?: string;

  /** Default state for folders: "collapsed" or "open" */
  folderDefaultState: "collapsed" | "open";

  /** Behavior when clicking folders: "collapse" to toggle, "link" to navigate */
  folderClickBehavior: "collapse" | "link";

  /** Whether to persist folder state in localStorage */
  useSavedState: boolean;

  /** Custom sort function for entries */
  sortFn?: (a: FileTrieNode, b: FileTrieNode) => number;

  /** Custom filter function for entries */
  filterFn?: (node: FileTrieNode) => boolean;

  /** Custom map function for transforming entries */
  mapFn?: (node: FileTrieNode) => void;

  /** Order in which to apply filter, map, and sort */
  order?: Array<"filter" | "map" | "sort">;
}

Default Behavior

By default, the Explorer:

  • Shows folders in a collapsed state
  • Opens folders when clicked (navigates to index page)
  • Saves folder states between sessions
  • Excludes the "tags" folder from the tree
  • Sorts folders first, then files alphabetically

Development

This is a first-party Quartz community plugin. It serves as both:

  1. A production-ready Explorer component
  2. A reference implementation for building Quartz community plugins

Documentation

See the Quartz documentation for more information.

License

MIT