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 not working - seeking help #165

Open
lbrent2k opened this issue Apr 15, 2024 · 3 comments
Open

Search not working - seeking help #165

lbrent2k opened this issue Apr 15, 2024 · 3 comments

Comments

@lbrent2k
Copy link

The index.json file in public is empty.

index.json in layouts/_default is:

{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

I run hugo server --config config/default/config.yaml --disableFastRender --logLevel debug and aside from search everything works great.

@Orlokun
Copy link

Orlokun commented May 29, 2024

Hi @lbrent2k, did you find a solution to this? I also can't make search work.
Thanks!

@lbrent2k
Copy link
Author

When I added content to blog I did get search results. I don't know if search is supposed to only be for blog though.

@Orlokun
Copy link

Orlokun commented May 29, 2024

Ok I fixed it on my end. My issue was that I was being sent to the template page when pressed the search results. #161

My config was fine, the problem was that on the baseUrl parameter at the beginning of the hugo file, I hadn't applied my site URL. and still had the template as base Url. Hope this works out for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants