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
When using i18_multisite plugin the generation of search.toml uses wrong URLs.
i18_multisite
search.toml
For example
[[input.files]] path = "pages/about_fr.html" url = "/pages/about_fr.html"
should be
[[input.files]] path = "pages/about_fr.html" url = "/fr/pages/about_fr.html"
To solve:
I18N_SUBSITES = { "fr": { "SITENAME": "Mon beau site", "SEARCH_I18_SUBSITE": "fr" } }
The patch for search.py:
search.py
--- ./search.py.bak 2023-02-20 17:00:10.379008769 +0100 +++ ./search.py 2023-02-20 17:19:26.119005800 +0100 @@ -30,6 +30,7 @@ self.tpages = settings.get("TEMPLATE_PAGES") self.search_mode = settings.get("SEARCH_MODE", "output") self.html_selector = settings.get("SEARCH_HTML_SELECTOR", "main") + self.i18_subsite = settings.get("SEARCH_I18_SUBSITE", None) def build_search_index(self, search_settings_path): if not which("stork"): @@ -62,6 +63,7 @@ pages += article.translations input_files = "" + url_i18_prefix = self.i18_subsite + "/" if self.i18_subsite is not None else "" # Generate list of articles and pages to index for page in pages: @@ -72,7 +74,7 @@ input_file = f""" [[input.files]] path = "{page_to_index}" - url = "/{page.url}" + url = "/{url_i18_prefix}{page.url}" title = {dumps(striptags(page.title))} """ input_files = "".join([input_files, input_file]) @@ -86,7 +88,7 @@ input_file = f""" [[input.files]] path = "{tpage_to_index}" - url = "{self.tpages[tpage]}" + url = "{url_i18_prefix}{self.tpages[tpage]}" title = "" """ input_files = "".join([input_files, input_file])
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When using
i18_multisite
plugin the generation ofsearch.toml
uses wrong URLs.For example
should be
To solve:
The patch for
search.py
:The text was updated successfully, but these errors were encountered: