google / docsy

A set of Hugo doc templates for launching open source content.
https://docsy.dev
Apache License 2.0
2.61k stars 898 forks source link

Does offlineSearch not working again? #1689

Closed MasonXon closed 1 year ago

MasonXon commented 1 year ago

I use the docsy-example with docsy 0.7.1 to build my site, but when I enable offlineSearch = true, It seems doesn't work , please ensure if bug appear again?

image
MasonXon commented 1 year ago

Does it not sending any request?

image
MasonXon commented 1 year ago

go.mod

module github.com/google/docsy-example

go 1.12

require (
    github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2 // indirect
    github.com/google/docsy v0.7.1 // indirect
    github.com/twbs/bootstrap v5.3.2+incompatible // indirect
)
tekezo commented 1 year ago

offline search works well on my machine.

diff from main branch:

diff --git a/hugo.toml b/hugo.toml
index 19ebd53..8ce7be3 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -141,13 +141,13 @@ github_project_repo = "https://github.com/google/docsy"
 github_branch= "main"

 # Google Custom Search Engine ID. Remove or comment out to disable search.
-gcs_engine_id = "d72aa9b2712488cc3"
+# gcs_engine_id = "d72aa9b2712488cc3"

 # Enable Algolia DocSearch
 algolia_docsearch = false

 # Enable Lunr.js offline search
-offlineSearch = false
+offlineSearch = true

 # Enable syntax highlighting and copy buttons on code blocks with Prism
 prism_syntax_highlighting = false
Screenshot 2023-10-13 at 8 13 15
MasonXon commented 1 year ago

What versions of these modules are you using? I found a new environment, and it really didn't work.

image
MasonXon commented 1 year ago

I only turn on offlineSearch = true, and other params keep default

MasonXon commented 1 year ago

I changed two machines, it's the same phenomenon.

tekezo commented 1 year ago

Did you disable gcs_engine_id in hugo.toml?

MasonXon commented 1 year ago

No, If I comment it out, it seems to run correctly.

I review your document, but I didn’t read it carefully enough. The description in the document says to comment out this parameter, rather than using a code block.

It's my fault, thank you so much