-
-
Notifications
You must be signed in to change notification settings - Fork 197
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: wrong searchindex URL with multilang per server config #940
Comments
Related to McShelby#940 Update `search.html` to handle BaseURLs with folders correctly and remove artificial language code prefixing. * Remove `.Site.LanguagePrefix` from the `$url` variable construction. * Change `relLangURL` to `relURL` for `window.index_js_url`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/McShelby/hugo-theme-relearn/issues/940?shareId=XXXX-XXXX-XXXX-XXXX).
Ok found the PR feature :) |
Thanks for the detailed bug report. Just for completeness, can you please post your |
I can not replicate this with my configuration. Please provide your Nevertheless, I have a vague idea why this may go wrong with your setup. |
Thanks, just saw your q for feedback and fix, didn't get to this sooner. |
Great job with the theme, thanks!
We needed to remove the artifical prefixing of the language code to make this work in search.html
to even use the default
_relearn_searchindex.js
from the assets folder of the themeBaseURL is
https://abc.aiprm.com/AIPRM-XYZ/
Site is multilingual
However the static files are only deployed 1 time, to
https://abc.aiprm.com/AIPRM-XYZ/_relearn_searchindex.js
The special case that someone deploys the same static files to language-prefixed folders cannot be default.
Also it was constructed wrong, as it ended up in
https://abc.aiprm.com/en/_relearn_searchindex.js
which doesn't even sit in the same home folder/vserver on the http
and the same for all other languages.
In a 2nd line of code we had the relLangURL, which again implies the special case being default - assets in language folders and enforces the current language prefixed
here's the diff and changed file attached, not sure how to commit/add directly to repo
diff --git a/layouts/partials/search.html b/layouts/partials/search.html
index 3c5acda17c..9b1c143f48 100644
--- a/layouts/partials/search.html
+++ b/layouts/partials/search.html
@@ -11,14 +11,14 @@
{{- warnf "UNSUPPORTED usage of 'searchpage' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" }}
{{- end }}
{{- if not .Site.Params.disableSearchIndex }}
search.html.zip
If there's a use case where people have separate static asset folders, then that would be a separate mode to implement imho,
but the default theme should work out-of-the-box imho.
Hope this helps.
The text was updated successfully, but these errors were encountered: