Closed pvojar closed 1 year ago
Thanks @pvojar reporting the issue.
Should I implement this also in my open PR? Seems like an easy fix, and search isn't working on my site either
@MarionMoseby please, send a separate PR.
@pvojar could you send your site URL's for testing?
I have been investigating and the issue is not that search is broken (https://www.pablomarcos.me/es/search/?keyword=ecsa works, for instance, if you manually change the keyword) but rather that the "get" form is not appending the ?keyword parameter at the end of the URL. I dont know how to fix this, but the solution is not to change $.getJSON( window.location.href.split("/search/")[0] + "/index.json", function( data ) {
into $.getJSON( "/index.json", function( data ) {
, as that would make search only work on the main site's language
Is there any update here? The search still doesn't work. If you try it on your guide it doesn't show any result: https://toha-guides.netlify.app/search/?keyword=Quickstart
Also, something happens to the UI after using the search box. Notice that the top menu bar gets fixed on the screen and overlaps the search box.
Try pulling main branch. Search should work now properly. Feel free to reopen if you still facing the issue.
Expected Behavior
Search feature should work on deployed site on Azure Static Web apps.
Current Behavior
Search doesn't return any results on deployed site. On Localhost development works without any problems.
Possible Solution
Steps to Reproduce
deploy toha site to Azure Static Web Apps, try search for post.
On Azure DevOps I found following warning
WARN 2022/01/20 14:31:38 Module "toha" is not compatible with this Hugo version; run "hugo mod graph" for more information. Start building sites …
Screenshots
Browsers Affected
Detailed Description
Edit search.js in toha/statics/js/search.js
old:
$.getJSON( window.location.href.split("/search/")[0] + "/index.json", function( data ) {
suggested
$.getJSON( "/index.json", function( data ) {
After this edit search started work correctly.