Skip to content

algolia.searchPagePath is not respected in resultsFooterComponent #8535

@AdrianMachado

Description

@AdrianMachado

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Within the Algolia configuration, one can specify a searchPagePath which allows you to designate the path of the search page. Naturally, the expectation is that any links to this search page should point to this page.
This is not the case, however, for the footer component of the search popup (pictured below). The "See all results" link instead uses the baseUrl (provided by useSearchPage. If the ${baseUrl}/search and searchPagePath are not the same path, then this link will end up being invalid.
image

Reproducible demo

https://github.com/zuplo/docs/blob/main/docusaurus.config.js

Steps to reproduce

  1. Setup a docusaurus project that uses Algolia, following the instruction here
  2. Configure an algolia.searchPagePath that is different from your basePath
  3. Launch your page and search for a single character in algolia Ex. "E"
  4. Scroll to the bottom of the results and click the "See all results" link

image

Expected behavior

Link should point to the search page, with the current query prefilled as the q param. Ex. https://www.my-page.com/<algolia.searchPagePath>?q=<query>

Actual behavior

Link points to the baseUrl with the path search appended, along with the current query prefilled as the q param. Ex. https://www.my-page.com/search?q=<query>.

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiondomain: searchRelated to the search feature, usually Algolia

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions