We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi. I recognized, that the language switching is not working if one disables the search bar in the config.toml.
[params] disableSearch = true
If so, you will get an error trying to change the language: Uncaught ReferenceError: baseUri is not defined. Beacuse of this part in the html-files:
<select id="select-language" onchange="location = baseUri + this.value;"> <option id="en" value="/" selected>English</option> <option id="de" value="/de/">Deutsch</option> </select>
This is because of a script in search.html (https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/partials/search.html), that should rather be somewehere else.
var index_url={{ "index.json" | relLangURL }}; var root_url="/"; var baseUri=root_url.replace(/\/$/, '');
I managed to work around this issue by putting the script in to the cusom-footer.html (https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/partials/custom-footer.html)
<script> var index_url={{ "index.json" | relLangURL }}; var root_url="/"; var baseUri=root_url.replace(/\/$/, ''); </script>
The text was updated successfully, but these errors were encountered:
Thanks for reporting. This is definatly a bug. Will be fixed with the next version.
Sorry, something went wrong.
search: don't break JS in multilang setup if search is disabled #140
48b0a66
McShelby
No branches or pull requests
Hi.
I recognized, that the language switching is not working if one disables the search bar in the config.toml.
If so, you will get an error trying to change the language: Uncaught ReferenceError: baseUri is not defined.
Beacuse of this part in the html-files:
This is because of a script in search.html (https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/partials/search.html), that should rather be somewehere else.
I managed to work around this issue by putting the script in to the cusom-footer.html (https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/partials/custom-footer.html)
The text was updated successfully, but these errors were encountered: