chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search does not work if default language is not English

IceFlom opened this issue · comments

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

  • Read the README.md
  • Have the extended version of Hugo installed
  • Used the exampleSite's config.toml as a reference
  • I have included my repository link. Instead of pasting long snippets here.

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):

  • OS: macOS 12.4
  • Browser: Safari 15.5 and Firefox 101.0.1

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.