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-index.json not loaded correctly if baseURL is set #91

Open
cdmaslo opened this issue Jan 20, 2024 · 2 comments
Open

search-index.json not loaded correctly if baseURL is set #91

cdmaslo opened this issue Jan 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cdmaslo
Copy link

cdmaslo commented Jan 20, 2024

Description

There is an error loading search-index.json file if the baseurl is set to anything else than "/"

Steps to reproduce

Make a new installation and set baseurl to "/something/"

Expected result

search-index.json is loaded

Actual result

search-index.json is not loaded

Environment

Not provided - useless

Bug location

In the file doks-core/assets/js/flexsearch.js is a mistake - baseURL is not used at all.
I have fixed it on my side using fetch('{{ "search-index.json" | absURL }}'), but this will not work for more languages

Original code:

  function buildIndex() {
    document.querySelector('.search-loading').classList.remove('d-none');
    fetch("{{ site.LanguagePrefix }}/search-index.json")
@h-enk h-enk added the bug Something isn't working label Jan 22, 2024
@h-enk
Copy link
Member

h-enk commented Jan 22, 2024

Thanks — it will be fixed properly!

Related: Deploy Doks to GitHub Pages generates an incorrect/not working search-index.json. Deployed at: https://gethyas.github.io/doks-gh-pages/

@h-enk
Copy link
Member

h-enk commented May 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants