Giter Club home page Giter Club logo

vuepress-plugin-meilisearch's Introduction

MeiliSearch-VuePress

MeiliSearch VuePress

npm version GitHub Workflow Status License Bors enabled

โšก The MeiliSearch plugin for VuePress

MeiliSearch VuePress is a MeiliSearch plugin for VuePress.

MeiliSearch is an open-source search engine. Discover what MeiliSearch is!

If you don't use VuePress for your documentation, but you still need a search bar, you might check out this front-end SDK.

MeiliSearch docs demo.

This plugin is used in production on the MeiliSearch documentation.

Table of Contents

Usage

Before using the plugin

The goal of this plugin is to provide very easy integration of a search bar into your own VuePress documentation. To make that possible, you need to gather your website content in advance, and index it in a MeiliSearch instance.

Luckily, we provide all the tools that you need, and can help you through the whole process, if you follow this guide ๐Ÿš€

As a first introduction, you might only want to test this plugin without connecting it to your website.
You can do it by running the VuePress playground provided in this repository:

yarn install
yarn serve

Then, open your browser on the indicated URL and test the search bar ๐Ÿ™‚

The data comes from MeiliSearch documentation.
Type create an indxe to live the MeiliSearch experience with the typo tolerance.

Installation

In your VuePress project:

yarn add vuepress-plugin-meilisearch
# or
npm install vuepress-plugin-meilisearch

Basic Configuration

In your config.js file:

module.exports = {
  plugins: [
    [
      'vuepress-plugin-meilisearch',
      {
        hostUrl: 'https://mymeilisearch.com',
        apiKey: 'XXX',
        indexUid: 'docs'
      }
    ]
  ]
}

WARNING: Since the configuration file is public, we recommend providing the MeiliSearch public key, which is enough to perform searches.
Read more about MeiliSearch authentication.

Customization

module.exports = {
  plugins: [
    [
      'vuepress-plugin-meilisearch',
      {
        hostUrl: 'https://mymeilisearch.com', // Mandatory
        apiKey: 'XXX', // Mandatory
        indexUid: 'docs-test', // Mandatory
        placeholder: 'Search as you type...', // Default: ""
        maxSuggestions: 10, // Default: 5
        hotKeys: [], // Default: ['s', '/']
        cropLength: 50, // Default: 30
        layout: 'simple', // Default: "columns"
        debug: true, // Default: false
        enableDarkMode: true // Default: false
      }
    ]
  ]
}

Dark mode

You can enable dark mode by adding enableDarkMode: true to your configuration file.

To override the default theme of the search bar, you can edit your .vuepress/styles/palette.styl file.
A few variables are available:

$accentDarkColor
$inputDarkBgColor
$textDarkColor
$borderDarkColor
$dropdownBgDarkColor

You can also find an example in our playground's palette.styl file

Compatibility with MeiliSearch

This package only guarantees the compatibility with the version v0.20.0 of MeiliSearch.

Development Workflow and Contributing

Any new contribution is more than welcome in this project!

If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!

Related Repositories

  • docs-searchbar.js: the library used to display the dropdown of this plugin. It can be useful if you want a search bar for your documentation but you don't use VuePress.
  • docs-scraper: the scraper used to scrap websites pages and automatically index the content in MeiliSearch.

MeiliSearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.

vuepress-plugin-meilisearch's People

Contributors

bors[bot] avatar dependabot-preview[bot] avatar curquiza avatar dependabot[bot] avatar mdubus avatar meili-bot avatar bidoubiwa avatar qdequele avatar

Watchers

James Cloos avatar

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.