How would I go about increasing the size limitation of the readFile
method? Currently reading a 1.5M file and it fails the build. That’s smaller than some JavaScript files.
kernel 5.6.11-arch1-1
hugo v0.70.0/extended linux/amd64
How would I go about increasing the size limitation of the readFile
method? Currently reading a 1.5M file and it fails the build. That’s smaller than some JavaScript files.
kernel 5.6.11-arch1-1
hugo v0.70.0/extended linux/amd64
1MB limit!
That’s correct. Its an arbitrary limit imposed here. Looks like the 1MiB limit may be lifted by rebuilding hugo after hacking the source.
a work around could be to split the file in many parts and loop / range over this files
That’s clever, and I’d consider it, but I’m working with historic files (read: 15-20 years old) and modifying them due to an arbitrary – and incredibly small – filesize limitation in hugo won’t meet my needs in this case unfortunately.
As a follow up, as a temp workaround I’ve taken to using the download
attribute for links to files with size > 1000000 bytes. In my shell scripts I identifiy large files using find
like so:
largefiles=(
$(find -maxdepth 1 -name "*" -size +1000000c -exec basename '{}' \;)
)
From a hugo perspective it feels there should at least be some kind of environment variable surfaced to increase the readFile
size limtation until there’s a better way to handle large files.
Very disappointing that the limit is so small, would very much appreciate a config variable to change this. Additionally disappointing that I can’t find the file size in Hugo to provide an alternative. I think I will temporarily move the large files and provide an alternative if they are not there.
How convenient! Thanks for linking this
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.