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 is not working #528

Closed
pradyungn opened this issue Mar 15, 2023 · 8 comments
Closed

Search is not working #528

pradyungn opened this issue Mar 15, 2023 · 8 comments

Comments

@pradyungn
Copy link

Both locally and on deployment, when I try to search I'lll sometimes see the loading wheel pop up for an instant then go away, but no results ever actually show up. When looking at search-data.---.json in my public directory, it's only generating an empty array. My config.toml is below - I haven't really customised any of the other partials, so not too sure where the error's popping up from?

# hugo server --minify --themesDir ... --baseURL=http://0.0.0.0:1313/theme/hugo-book/

baseURL = '{URL}'
title = 'Docs'
theme = 'hugo-book'
language-code="en-US"

# Book configuration
disablePathToLower = true
enableGitInfo = true

# Needed for mermaid/katex shortcodes
[markup]
[markup.goldmark.renderer]
  unsafe = true

[markup.tableOfContents]
  startLevel = 1

[params]
  BookTheme = 'auto'
  BookToC = true
  BookSection = 'docs'
  BookRepo = 'https://github.com/pradyungn/ECE385-systemverilog-docs'
  BookDateFormat = 'January 2, 2006'
  BookSearch = true
  BookComments = false

  BookPortableLinks = false
  BookServiceWorker = false
  BookTranslatedOnly = false

@MakeJames
Copy link

I was also seeing this issue, I think it directly relates to the issue raised in #525

I managed to fix this by createing a assets/search-data.json file with the problematic line removed.

@pradyungn
Copy link
Author

That fixed it, thanks! Gonna keep the issue open for now since the root issue is still valid

@ai-smalleryu
Copy link

修好了,谢谢!由于根本问题仍然有效,因此暂时保留该问题
How did you do it? I still haven’t solved it. I think it’s because of the template scanning problem in search-data.json, because when I modify this template, there will be replacements in the generated json file, and the function remains the same. No effect

@dirk2011
Copy link

Great the solution works for me also, using Hugo version 0.111.3, thanks very much.

qkzk added a commit to qkzk/qkzk that referenced this issue Apr 13, 2023
qkzk added a commit to qkzk/qkzk.github.io that referenced this issue Apr 13, 2023
tsingwang added a commit to tsingwang/wiki that referenced this issue Apr 15, 2023
@alex-shpak
Copy link
Owner

Hi!
Seems like there was a change in hugo that broke that logic, I will take a look.

@alex-shpak
Copy link
Owner

Could be related: gohugoio/hugo#6015

@alex-shpak
Copy link
Owner

I pushed hotfix for now

@HazardPassado
Copy link

So, this comment is to help someone googling in the future with this behavior. If you are running Hugo as an AWS Amplify site, it will pin an old version of Hugo (0.75.2.) Manually updating the version to 0.118.2 cured this for me after pulling a lot of my hair out trying to track it down.

More an amplify bug than a Hugo bug, and certainly not a fault with the theme.

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

6 participants