Skip to content

A plugin that adds fuzzy search functionality to Publii static sites using the powerful Fuse.js JavaScript library.

License

Notifications You must be signed in to change notification settings

Prashantpathak5022/publii-fuzzy-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Publii Static Fuzzy Search Plugin

A third-party plugin that adds fuzzy search functionality to Publii static sites using the powerful Fuse.js JavaScript library.

⚠️ This plugin is not affiliated with Publii or Fuse.js.

Features

  • 🚀 Lightweight, client-side fuzzy search
  • 🔎 Searches across post titles, summaries, and tags
  • 📂 Works with a static JSON feed (no backend required)
  • 📡 No external requests – Fuse.js is bundled locally
  • 🖍 Optional result highlighting for matched keywords
  • 🔗 Search term stays in the URL for easy sharing

Demo

Here’s how the live fuzzy search works:

Search Demo

Images

Here’s how the live fuzzy search works:

Plugin Homepage

Plugin Homepage 2

Installation

You can install the plugin using either of the following methods:

Install via Publii UI (Recommended)

  1. Download the plugin ZIP from this GitHub repository under Releases.
  2. Open the Publii app and go to PluginsAdd new.
  3. Select the downloaded ZIP file.
  4. Activate the plugin once installed.

Requirements

To use the plugin, you must enable the following settings in your Publii site:

In Theme SettingsSearch:

  • ✅ Enable Search
  • ✅ Enable Search Subpage

In Site SettingsRSS/JSON Feed:

  • ✅ Enable JSON Feed

Without these, the plugin will not function.

How It Works

  • The plugin fetches your static JSON feed (feed.json)
  • It indexes post data with Fuse.js using options like:
    • title, summary, tags
    • fuzzy matching with diacritic support, score sorting, and extended search
  • Input is matched live and results are displayed immediately
  • URL is updated in real time for deep-linking/search-sharing
  • Matched text is highlighted using <mark> tags

Example Output

<h5><a href="/post-url">Matching Post Title</a></h5>
<p>This is a matching summary with <mark>highlighted</mark> terms.</p>

If you encounter any issues or have any questions, please feel free to open an issue in this repository.


Credits

This plugin was created by me with invaluable help from @freaks-dev.

Special thanks to:

  • Publii for their amazing static site generator
  • Fuse.js for their powerful fuzzy search js library

License

This plugin is released under the GPL-3.0 license.

About

A plugin that adds fuzzy search functionality to Publii static sites using the powerful Fuse.js JavaScript library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published