Is it possible to ignore a directory inside staticDir?
I have a bootstrap theme that is built using gulp. It generates a dist folder containing a few subfolders: dist/css, dist/fonts, dist/img, dist/video, dist/js.
I only need the dist/cssdist/fonts and dist/js, so I added those to hugo as staticDirs. The problem is that all the files are added to the website root, so the relative links get messed up.
If I was able to add the dist directory to the staticDir, then it would maintain the folder heirarchy and everything would work. The problem is that it also adds the theme’s video and image files, which I do not want. Is there any way to make them get ignored?
Another solution I’ve thought about is editing the theme’s files to fix the links, but that leaves a high likelihood of making a mistake. It also makes updating the theme much more difficult.
Lastly, I’ve also though about modifying the gulpfile to create a second folder just for the files I want to use in hugo, but I’m not that experienced with gulp and don’t think I could modify it properly (especially with all the fancy file watching, cleaning, etc. that the gulpfile is doing).
Thanks for the suggestion. That’s what I meant in the last paragraph, but the way the gupfile is structured makes it difficult (and I’m still new with gulp). I’d rather do it through hugo if at all possible so that way I won’t have to be modifying the theme’s files.
Thanks for the suggestion but it didn’t work. I tried a bunch of different strings and couldn’t get it to work.
I even tried using the example from the documentation ignoreFiles = [ "\\.foo$", "\\.boo$" ] but I replaced foo with mp4 and the file was still being copied over.
gulp generates the static assets I need for my webpages into its own special directory structure that the theme developer chose. I’m attempting to point hugo’s staticDir to those assets, without copying unnecessary files (e.g., sample videos and sample images). If I pick and choose only the folders I want, then hugo flattens them into the sites root directory and all the relative links get broken.
From the answers I’m getting it seems that hugo is unable to do this at this point in time. My backup plan is to edit the bootstrap themes files to fix the relative links, but that was something I was hoping to avoid.
I did some searching on the hugo github repo, and it seems like this is an issue that someone has already created a pull request for.