Giter Site home page Giter Site logo

catchesearch / catche-search-widget Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 1.0 939 KB

A low-code way to add instant search to your website

Home Page: https://try.catche.co/

License: GNU General Public License v3.0

HTML 5.63% JavaScript 2.72% Vue 60.18% CSS 6.36% TypeScript 25.11%
search search-engine site-search search-interface instantsearch fuzzy-search typesense elasticsearch algolia low-code

catche-search-widget's Introduction

Catche Search Widget

AKA a Ctrl/Cmd-K Menu or a Command Palette

Example of Catche instant search

Catche provides a low-code way to add instant search to your website in two steps!

  1. Go to https://try.catche.co and enter your website URL
  2. Add the provided code snippet to your website's <head>

This repo contains the open-source code for the client-side widget.

For those who are interested in theming their widget or using self-hosted data, check out the Tutorials section below.

Contributions welcome!

Overview

This widget is built with Vue and TypeScript and uses Tailwind for styling.

Catche uses Supabase for our database hosting but you don't need to do that if you intend to self-host your data - you just need a JSON file!

We use MiniSearch for searching, while fast-fuzzy is used for highlighting.

Tutorials

Note - the index.html files in the tutorial folders cannot be opened as-is, due to several requirements in the scripts. Instead, run a local server via Node or Python.

Themes

See tutorials/theme for relevant files.

You can theme the widget via the catche-css attribute in the <script> element, which should take the path to the .css file.

<script catche-css="PATH/TO/CSS" type="module" crossorigin src="PATH/TO/WIDGET/index.js"></script>

See tutorials/theme/dark.css for an example of the relevant CSS attributes.

Custom Data

See tutorials/selfhost for relevant files.

You can use your own data saved in a .json file, via the catche-data attribute in the <script> element, which should take the path to the .json file.

<script catche-data="PATH/TO/JSON" type="module" crossorigin src="PATH/TO/WIDGET/index.js"></script>

The .json file should contain an array of objects, where each object represents a webpage with the following attributes:

  • id - unique string
  • url - URL of webpage
  • title - title of webpage
  • text - text of webpage

The widget will search through the title and text attributes.

See tutorials/selfhost/my-data.json for an example of the data format.

catche-search-widget's People

Contributors

alfredlua avatar greentfrapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

brc-dd

catche-search-widget's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.