No description
Find a file
saberzero1 d17eab96c5
fix: use fetchData global for path-prefixed deployments
- Update types/globals.d.ts with centralized type declarations
- Use fetchData global instead of hardcoded /static/contentIndex.json
- Revert @quartz-community/types from file:../types to github:quartz-community/types
- Add .prettierignore, update .eslintrc.json with triple-slash-reference override
- Remove duplicate scripts.d.ts/styles.d.ts
2026-03-16 18:54:25 +01:00
.github/workflows Initial commit 2026-02-07 07:31:38 +01:00
dist fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
src fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01: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 fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
package.json fix: add flexsearch and utils transitive deps to devDependencies for build 2026-03-14 22:16:02 +01:00
README.md fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
tsconfig.json fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +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 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