Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
IceFlom opened this issue Jun 26, 2022 · 1 comment
Open
4 tasks done

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

IceFlom opened this issue Jun 26, 2022 · 1 comment
Assignees

Comments

@IceFlom
Copy link
Contributor

IceFlom commented Jun 26, 2022

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
@onweru onweru self-assigned this Jun 29, 2022
@cqhudson
Copy link

cqhudson commented Mar 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants