Closed rainerhillebrand closed 11 months ago
I have built a number of multilingual sites but I do not believe I have ever enabled this search functionality on any of them.
Thanks for alerting me to this issue and providing som good data! I will investigate and report back in this issue. In might take a week or so before I have time to spend on it.
It is definitely a issue I want to fix in my theme.
@rainerhillebrand @calalloo Tank you both for alerting me to this issue and to remind me about it.
If you have time, please test this PR #106.
The search index was already getting generated for each languages. The bug was that the search javascript was not made to look for it. The PR hopefully fixes that.
Dear Fredrik,
first of all thank you very much for your excellent theme!
I prepared a bilingual site based on your theme. When testing the search function I noticed that the search results are provided for the default language only. The root cause may be the fixed path '/searchindex.json' in buildIndex() in assets/js/search.js. This works fine for the default language. However, the search function on my site works only when I use '/es/searchindex.json' for the second language (which is Spanish).
Are you quite positive that the search function works on a multi-lingual site?
I partially solved this issue for my site with the following changes:
by
by
My remaining problem is that the defaultContentLanguageInSubdir has the default value false. This means that {{ site.Language.Lang }} results in "de" but searchindex.json is not stored in '/de/searchindex.json'. I wanted to check whether defaultContentLanguageInSubdir is true or false (like LisaFC, see Check if default language content is in a language subdir?). However, I did not succeed,yet.
Best regards,
Rainer