No description
Find a file
2026-03-30 00:36:49 +02:00
.github/workflows ci: add dist externals verification step 2026-03-17 19:41:48 +01:00
dist fix: boost sidebar z-index to 9999 when search opens to ensure modal is above all content 2026-03-30 00:36:49 +02:00
src fix: boost sidebar z-index to 9999 when search opens to ensure modal is above all content 2026-03-30 00:36:49 +02:00
test fix: resolve CI failures by fixing lint config and test setup 2026-02-09 12:58:51 +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 22:01:25 +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 07:31:38 +01:00
CHANGELOG.md Initial commit 2026-02-07 07:31:38 +01:00
LICENSE Initial commit 2026-02-07 07:31:38 +01:00
package-lock.json chore: update @quartz-community/utils to 8d2e14b 2026-03-22 12:38:26 +01:00
package.json fix: bundle non-shared deps into dist to prevent runtime resolution failures 2026-03-17 19:31:51 +01:00
README.md fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +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 fix: move tsconfig from dts object to top-level option 2026-03-22 13:25:12 +01:00
vitest.config.ts fix: resolve CI failures by fixing lint config and test setup 2026-02-09 12:58:51 +01:00

@quartz-community/search

The Search component for Quartz - full-text search with FlexSearch integration.

Features

  • 🔍 Full-Text Search - Search across all your content instantly
  • Fast Indexing - Uses FlexSearch for high-performance search
  • 📱 Mobile Responsive - Works great on all devices
  • 🎯 Search Preview - Optional content preview panel
  • 🌐 Multi-Language - Supports 30+ locales
  • ⌨️ Keyboard Shortcuts - Ctrl/Cmd + K to open, Escape to close
  • 🏷️ Tag Search - Search by tags with special syntax

Installation

npx quartz plugin add github:quartz-community/search

Usage

plugins:
  - source: github:quartz-community/search
    enabled: true
    layout:
      position: left
      priority: 20
      group: toolbar
      groupOptions:
        grow: true

For advanced use cases, you can override in TypeScript:

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

ExternalPlugin.Search({
  enablePreview: true,
  placeholder: "Search for something",
  title: "Search",
});

Configuration Options

interface SearchOptions {
  /** Enable content preview panel */
  enablePreview?: boolean;
  /** Custom placeholder text */
  placeholder?: string;
  /** Custom title for the search button */
  title?: string;
}

Default Behavior

By default, the search component:

  • Displays as a button with a search icon
  • Opens a fullscreen search modal when clicked
  • Shows up to 8 search results
  • Enables content preview on desktop (can be disabled)
  • Supports keyboard navigation (arrow keys, Enter, Escape)
  • Uses FlexSearch from CDN for indexing

How It Works

The Search component:

  1. Loads FlexSearch library from CDN when initialized
  2. Fetches content data via the fetchData global (resolves contentIndex.json with the correct base path)
  3. Builds a search index from your content
  4. Performs real-time search as you type
  5. Shows results with optional content preview

[!info] Search requires the ContentIndex emitter plugin to be present in your Quartz configuration.

Keyboard Shortcuts

  • Ctrl/Cmd + K - Open/Close search
  • Escape - Close search
  • Arrow Up/Down - Navigate results
  • Enter - Open selected result

Development

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

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

To build locally:

npm install
npm run build

The prepare script automatically builds during installation.

Documentation

See the Quartz documentation for more information.

License

MIT