I would like to use the PhotoSwipe library on my Hugo site and I’m wondering what the best way to include this library is. I could of course just download the files from the git repo and include them in my project, but I would like to know if there’s anyone using a different method.
lib folder, e.g.
So far, I have thought of or found a few options.
Using npm and a symlink
As described in Reference js file outside assets directory, install using npm and create a symlink inside
Using npm and a build tool
It’s always possible to use gulp or grunt to move js files around before starting Hugo, but I’d preferably have as few dependencies as possible, and use the new Hugo pipes feature where applicable.
Clone the library’s repo into
git submodule. The disadvantage of this is that the entire repo is cloned, where usually only the
distfolder is needed.
I’m curious if anyone uses or knows any other options. Thanks!