chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
578 stars 266 forks source link

Search does not work if default language is not English #333

Open IceFlom opened 2 years ago

IceFlom commented 2 years ago

I have checked all the prerequisites below and I'm yet experiencing a problem

Describe the bug

As soon as the default language of the page is set to something other than English (in my case German (Deutsch) = "de"), the search box stops responding when you type something. Nothing is suggested and you can't confirm the search with ENTER. As soon as the page is set back to English "en", it works again.

I suspect the problem in the file assets/js/search.js. Here is a hardcoded query on "en" contained. If I change this to "de", the search works again. But I don't know exactly what happens at this point or how to adjust this generally.

Desktop (please complete the following information):

cqhudson commented 1 year ago

Having a similar issue, when deleting Portuguese from the default languages.toml included in the exampleSite in order to remove the language menu. Once the Portuguese section in languages.toml is deleted, search becomes unresponsive.

Oddly enough, as long as there are 2 languages in languages.toml, search works. For example, I changed the [pt] line to [ru] and search still works.

Deleting languages.toml also kills search.