No description
Find a file
saberzero1 5f2df462c9
chore: commit dist/ and remove prepare script
Pre-built output is now committed to the repository so that
Quartz can skip the build step during plugin installation.
The prepare script is removed to prevent redundant builds
when installing from npm/git.
2026-03-14 22:01:25 +01:00
.github/workflows Initial commit 2026-02-07 07:31:38 +01:00
dist chore: commit dist/ and remove prepare script 2026-03-14 22:01:25 +01:00
src feat: add render event listener for in-place DOM re-initialization 2026-03-12 19:45:41 +01:00
test fix: resolve CI failures by fixing lint config and test setup 2026-02-09 12:58:51 +01:00
.eslintrc.json fix: resolve CI failures by fixing lint config and test setup 2026-02-09 12:58:51 +01:00
.gitignore chore: commit dist/ and remove prepare script 2026-03-14 22:01: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: commit dist/ and remove prepare script 2026-03-14 22:01:25 +01:00
package.json chore: commit dist/ and remove prepare script 2026-03-14 22:01:25 +01:00
README.md docs: update README for v5 unified config system 2026-02-25 16:07:11 +01:00
tsconfig.json Migrate types to use @quartz-community/types exports 2026-02-13 13:18:29 +01:00
tsup.config.ts fix: compile SCSS via sass instead of raw text to prevent lightningcss errors 2026-02-26 16:44:51 +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 from /static/contentIndex.json
  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