-
Notifications
You must be signed in to change notification settings - Fork 72
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 bar doesn't work #31
Comments
I figured this one out. If you open You can replace:
With:
Note the additional slashes after the three instances of {{ .Site.BaseURL }}. Adding these slashes directs your browser to the correct location for the javascript and seems to make the difference. |
But my footer.html file was already empty. Isn't that weird? |
Hi, will investigate this issue in the coming week. Apologies for slow response, very busy with other stuff! |
No issues, @julianflapper!! |
As for the time being, I've disabled the search bar on my website. But I would really love to have a search bar, so if you need any information from my side, do let me know. |
@PRUBHTEJ looking at your repo, are you even using Hugo and Ace? It looks like the entire theme structure is not present, nor do I see any of the config or Markdown files. Also, when loading your site, none of the Javascript libraries are loaded: jQuery, Popper, Bootstrap, and also none of the search libraries: Lunr, auro-complete, search.js, etc. I would advise you to try a fresh installation of Hugo and Ace and see if the search works there. Because for me it does, to it must be something on your end. The ""/" characters you've added in your footer shouldn't be necessary. Check if you have a "/" behind your baseURL variable in your config.toml. |
Are you viewing this repo: https://github.com/SynBioHub/synbiohub-docs ? |
@PRUBHTEJ no I was viewing the other repo you tagged. But still, you don't have the correct footer file: Should be: https://github.com/vantagedesign/ace-documentation/blob/master/layouts/partials/footer.html Unless you've made major changes to the theme, I would advise to just reinstall the theme alltogether to make sure everything is installed correctly. |
No, actually, I did not do any changes to the theme. |
I'll change the footer.html file. |
@PRUBHTEJ I would then just remove the entire Ace theme and re-install it to make sure everything is correct. |
Okay, I'll do that then! |
@PRUBHTEJ if solved, please close the issue. Good luck :) |
Sure! |
The footer.html file shall be auto generated upon hugo-D? |
@PRUBHTEJ is it empty again? It shouldn't be empty. It should be exactly as how I sent it a few messages ago |
What I did was to remove hugo and as well as ace and then reinstalled them, but still footer.html is empty. |
@PRUBHTEJ lol weird, that can't be because you're downloading this repo and that includes this file: |
I'll reinstall it again and get back to you. |
I also had some issues with the search bar. I didn't find what was the real problem but what I did to solve this was to start working off the |
I have the same problem, and I was able to boil down the error to the following: What I wonder is, why isn't it found? The This is from line 14 of // Initialize lunrjs using our generated index file
function initLunr(success_callback) {
if (!endsWith(baseurl,"/")){
baseurl = baseurl+'/'
};
// First retrieve the index file
$.getJSON(baseurl +"index.json") // Fails right here.
.done(function(index) {
pagesIndex = index;
// Set up lunrjs by declaring the fields we use
// Also provide their boost level for the ranking
lunrIndex = new lunr.Index;
lunrIndex.ref("uri");
lunrIndex.field('title', {
boost: 15
});
lunrIndex.field('tags', {
boost: 10
});
lunrIndex.field("content", {
boost: 5
});
// Feed lunr with each file and let lunr actually index them
pagesIndex.forEach(function(page) {
lunrIndex.add(page);
});
lunrIndex.pipeline.remove(lunrIndex.stemmer)
success_callback();
})
.fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.error("Error getting Hugo index file:", error);
});
} The [
{{ range $index, $page := .Site.Pages }}
{{- if and (ne $page.Type "json") (ne $page.Type "html") -}}
{{- if and $index (gt $index 0) -}},{{- end }}
{
"uri": "{{ $page.Permalink }}",
"title": {{ $page.Title | jsonify }},
"tags": {{ $page.Params.tags | jsonify }},
"description": {{ .Description | jsonify }},
"content": {{$page.Plain | jsonify}}
}
{{- end -}}
{{- end -}}
] |
Hey!
The search bar located on the top left hand side doesn't seem to work.
Whenever I enter anything into the search bar, it redirects me to the home page.
What could be the possible issue?
The text was updated successfully, but these errors were encountered: