hi,
I have quite big media library - 20GB.
On each build this media library is copied from “content” folder to “public” folder. Is there any way to tell hugo to create a symlink instead copy?
Tnx.
hi,
I have quite big media library - 20GB.
On each build this media library is copied from “content” folder to “public” folder. Is there any way to tell hugo to create a symlink instead copy?
Tnx.
I’m not sure about the symlinks but I’ve used Hugo for a couple podcast websites. The .mp3 files quickly started to take up a lot of room. What I did was hosts those files separately and then link to them separately.
For example, if my Hugo site was located at https://Example.com, I hosted my files at https://files.Example.com. This allows me to just use URLs to refer to the files from within Hugo but Hugo didn’t have to build or copy those files and I didn’t need to store those big files in Git either was made git push/pull much faster.
Tnx for tip but its not option for me as I need to resize those images sometimes.
Ah okay. Then I don’t see how a symlink will work either as Hugo needs to process the images and then put them somewhere. A symlink would modify the originals. If you’re okay with that, then I’d use a proper image program on those images first. You’d want to keep any files Hugo needs to modify or generate separate from your source as you never know if it makes a mistake or you change your mind.
As far as I know hugo does not modify originals but having symlink on folder will save resized images in original folder. To avoid that it would be perfect that hugo would symlink only files and not folders. It could be done with “cp -Rs folder_src folder_dest”.
This way you can not destroy originals and you will not polute the original folders with resized images.
Hugo does not have an option for that. But we should fix these “big image library” use cases. There are several related issues here:
resources.Get
.I’m not sure what’s the common web server support out there for symlinks, though. I think it is turned off by default in Apache, to take one example.
+1 for the first dot
Working with page bundles - would help to not copy local asset dirs
Could we have a frontmatter entry like ignoreDir =“assets” ?
VERY DIRTY WORKAOUND
I used resources.Match “assets.*” to process the files
IF the assets directory is HIDDEN, the original files will not copied
BUT NOT PRACTICAL
NGINX follows symlinks by default: Module ngx_http_core_module