Lunr.js for offline search with default CDN is not working #2049
Unanswered
pankeshpatel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to enable Lunr.js offline search in my hugo site with docsy theme.
I have enabled the following in my config.toml file
and disabled the following
algolia_docsearch
,gcs_engine_id
when I run locally on my mac, the search functionality works.
however, when I deployed it on S3 bucket by CloudFront, it gave me the following error
Upon some trial and test, I have realized that this CDN
'https://unpkg.com/lunr@2.3.8/lunr.min.js
causes an issue.When I add the following CDN manually on my pages and upload to S3 bucket, the search function works.
My hugo with docsy them project use the following this submodules https://github.com/google/docsy/tree/2bedb2ff278eddba4a7fc4441ca6bf7a42caeb68
This submodule by default puts
"https://unpkg.com/lunr@2.3.8/lunr.min.js"
CDN and does not allow me to change it to"https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min.js"
My question is how could I resolve this CDN issue to enable "offline-search"
The submodule overwrites my changes. So it prevents me from putting any content security
meta
tag. https://github.com/google/docsy/tree/2bedb2ff278eddba4a7fc4441ca6bf7a42caeb68Beta Was this translation helpful? Give feedback.
All reactions