Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get Typesense to work with VuePress 2.x #255

Open
ricoapon opened this issue Sep 2, 2024 · 0 comments
Open

Cannot get Typesense to work with VuePress 2.x #255

ricoapon opened this issue Sep 2, 2024 · 0 comments

Comments

@ricoapon
Copy link

ricoapon commented Sep 2, 2024

Description

There is documentation on how to use your own Typesense server in Vuepress. This seems to be created for VuePress 1.x. I cannot get it to work on VuePress 2.x.

Broken component

The component TypesenseSearchBox.vue does not work out of the box anymore for multiple reasons.

  1. Components are not automatically registered anymore. You need to install the plugin @vuepress/plugin-register-components and configure this.
  2. It requires the docsearch dependency, but this is not included. You need to install the plugin @vuepress/plugin-docsearch for this. Couldn't get this to work, so I manually downloaded the docsearch javascript files and added this.
  3. Options are not configurable anymore in themeConfig. This works differently. I don't know what would be the equivalent.

What I tried

I tried to configure the plugin @vuepress/plugin-docsearch. I think this is the way forward, but I could not make it work. The reason is that I cannot get a proper client to work. Maybe somebody with expertise can help me figure this out.

What I did:

  1. Create a new VuePress 2 project.
  2. Install the plugin @vuepress/plugin-docsearch.
  3. Created the file src/.vuepress/client.ts and gave it the following content:
import {defineDocSearchConfig} from "@vuepress/plugin-docsearch/client";
defineDocSearchConfig({
    // @ts-ignore
    transformSearchClient: (searchClient) => {
        return ??? // What to fill in here?
    }
})

I think if I could make this transformSearchClient work, then it would be perfect. However, I don't know what to use. I tried to use typesense-docsearch, but this requires React, and that doesn't work. I hope that we can figure this out, and if we do, that we document it on the website as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant