vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
12.83k stars 2.07k forks source link

FR(theme): Add a separate page for search #2983

Open qwerzl opened 1 year ago

qwerzl commented 1 year ago

Is your feature request related to a problem? Please describe.

Algolia's search box is awesome, but when searching for more detailed information, it's better to have a separate search page. This will also help to add OpenSearch support as proposed in #2855.

Describe the solution you'd like

A separate search page located at /search. Docusaurus has a nice example: CleanShot 2023-09-18 at 22 15 21@2x

Describe alternatives you've considered

No response

Additional context

No response

Validations

simply-none commented 1 year ago

Is your feature request related to a problem? Please describe.

您的功能请求是否与问题相关?请描述。 Algolia's search box is awesome, but when searching for more detailed information, it's better to have a separate search page. This will also help to add OpenSearch support as proposed in #2855.Algolia的搜索框很棒,但是在搜索更详细的信息时,最好有一个单独的搜索页面。这也将有助于添加#2855中提议的OpenSearch支持。

Describe the solution you'd like

描述您想要的解决方案 A separate search page located at /search. Docusaurus has a nice example:位于 的 /search 单独搜索页面。Docusaurus有一个很好的例子: CleanShot 2023-09-18 at 22 15 21@2x

Describe alternatives you've considered

描述您考虑过的替代方案 No response 无响应

Additional context 其他上下文

No response 无响应

Validations 验证

  • [x] Follow our Code of Conduct遵守我们的行为准则
  • [x] Read the docs. 阅读文档。
  • [x] Read the Contributing Guidelines.阅读贡献指南。
  • [x] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.检查是否还没有要求相同功能以避免创建重复项的问题。

hello, why your algolia can return more than 5 items, and me only look 5 items result, like this: image can you give me one example to fix it ?thanks

brc-dd commented 1 year ago

hello, why your algolia can return more than 5 items, and me only look 5 items result, like this: can you give me one example to fix it ?

It's not fixable - https://support.algolia.com/hc/en-us/articles/11467266080017-Why-does-my-search-on-Docsearch-only-return-5-results-on-a-page-when-there-should-be-more-

brc-dd commented 1 year ago

@simply-none On further investigation, it looks like something like this works:

    search: {
      provider: 'algolia',
      options: {
        appId: '...',
        apiKey: '...',
        indexName: '..',
        // @ts-ignore
        maxResultsPerGroup: 10 // <--
      }
    },
simply-none commented 1 year ago

@simply-none On further investigation, it looks like something like this works:经过进一步调查,它看起来像这样工作:

    search: {
      provider: 'algolia',
      options: {
        appId: '...',
        apiKey: '...',
        indexName: '..',
        // @ts-ignore
        maxResultsPerGroup: 10 // <--
      }
    },

thanks, it's very useful👍👍👍