Closed Robin-Wils closed 2 years ago
Initialize the hugo module system: hugo mod init github.com/kaushalmodi/hugo-search-fuse-js
is also a required step, which is missing in the readme. After that go mod tidy
seems to be needed as well.
go mod tidy can be skipped it seems.
Nevermind I can't get it working. I will stick with the older version for now.
By the way, it seems like the JavaScript libraries could be linked as module as well, to automatically keep them up to date: https://geeksocket.in/posts/hugo-modules/
For some reason if I import the external libs as modules it works fine, but this module does not. The mounts are optional it should mount everything of this repo by default. Not sure why it does not work
config.toml
[module]
[[module.imports]]
path = "github.com/krisk/Fuse"
[[module.mounts]]
source = 'dist/fuse.min.js'
target = 'assets/js/libs/fuse.min.js'
[[module.imports]]
path = "github.com/julmot/mark.js"
[[module.mounts]]
source = 'dist/mark.min.js'
target = 'assets/js/libs/mark.min.js'
[[module.imports]]
path = "github.com/kaushalmodi/hugo-search-fuse-js"
[[module.mounts]]
source = 'static'
target = 'static'
[[module.mounts]]
source = 'layouts'
target = 'layouts'
[[module.mounts]]
source = 'assets'
target = 'assets'
Thanks, I'll fix the typo, but you should need to hugo mod init in this repo. You do need to hugo mod init in the repo where you use this module if you are starting to use modules.
Can you try to follow this ox-hugo Quick Start guide and see if the module setup instructions in there work for you?
I'll investigate in some time on how to fetch the external libs via hugo mod, but it's not highest on my priority list.
If you figure it out first, please do open a PR!
Thanks. :)
I think my own theme has to be a module for that as well or something. Nothing seems to work. hugo mod init
was executed. Modules and themes which aren't imported by modules don't seem to work well together.
I think I figured out how to fetch the external libs, in the config.toml of my theme, but this component doesn't get imported somehow, so didn't really test it fully. Branch: https://gitlab.com/RobinWils/robinwils.com/-/tree/update-to-latest-hugo-search-fuse-js
Recursive module fetching does work (I am doing that for my main site), but I agree that getting hugo mod to work with a complicated setup is time consuming in the beginning.
I think I am getting somewhere. It does seem to run now locally. Just need some time to get it working.
Yeah, can't get it working somehow.
hugo mod -get -u
should behugo mod get -u
the first command will fail.