My colleagues and I are using the nextra docs-theme to build our documentation site. During development, we encountered an issue: the Search Bar, powered by FlexSearch, does not index content from our custom React components imported in .mdx files. It seems to only index the plain text written directly within the .mdx files.
Upon investigating, we found that the data used by the search bar is sourced from a JSON file located at .next/static/chunks/nextra-data-${locale}.json. This file contains metadata such as the path to the .mdx file, its title, and the data to be indexed. Here's an example of the file's structure:
Hello Nextra Team,
My colleagues and I are using the
nextra docs-theme
to build our documentation site. During development, we encountered an issue: theSearch Bar
, powered byFlexSearch
, does not index content from our customReact components
imported in.mdx
files. It seems to only index the plain text written directly within the.mdx
files.Upon investigating, we found that the data used by the search bar is sourced from a JSON file located at
.next/static/chunks/nextra-data-${locale}.json
. This file contains metadata such as thepath
to the.mdx
file, itstitle
, and thedata
to be indexed. Here's an example of the file's structure:The
DataStore.mdx
file imports aReact Component
and looks like this:When we search for content in the
DataStore
file, no results are returned, likely because thedata
object is empty for that file.Could you offer any guidance on how to resolve this issue so that content from custom React components is indexed properly in the search?
Thank you for your help!
Best regards,
Kalin