Search not working when i deploy website online

Good evening

I have a problem the search bar works locally in the address localhost:1313 but does not work when I deploy my site online !

Do you have any solutions ?

See the Requesting Help guidelines.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

1 Like

Does it have to contain ( repository ) the whole site?

:point_up_2:

here is my repository

I cloned your site and deployed to Netlify and the search is working as expected. Try looking at the developer console in your browser and see if any errors occur.

i use hugo command to deploy on my server and this is my website online

First, baseURL = '/' is not valid and should be the same as the URL you are deploying your site to including the protocol (https), so baseURL = 'https://nedjma.org/'. But I don’t know how to help you further since it worked on my end.

Does anyone know where the problem lies?

The google search worked for me, I put in “test” and got one of your articles.

In that you had a link to an image like this: “http://127.0.0.1/wordpress-test/wp-content/uploads/2021/12/image-1.png” so there are other issues