zola
zola copied to clipboard
Asset colocation for files without an extension
Hi!
In versions 0.15.3 to 0.17.0 Zola would colocate files without an extension. I serve files without an extension on my website fairly frequently and would prefer to avoid renaming them if possible (rehosting challenge binaries for CTF writeups). I would like to be able to configure and disable that behavior. I'm happy to fix and MR this but wanted to chat about design first.
Thanks!
Can you pinpoint the commit that changed the behaviour? I don't think that was intentional
https://github.com/getzola/zola/commit/f363ea1ae8ea2626e58c116fce03e59653a3c762#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
Ah I forgot about that! Maybe we should allow files without extensions?
I use files without an extension. It kinda looks like it would be a hassle to wire up the config code with the code that filters out extensionless files, but tbh I can't really think of a use case where extensionless files should be filtered out. maybe i'm just too linux-brained lol but it seems like they are pretty common and not having an extension doesn't really signify anything.
The thought (I believe) was that if it didn't have an extension it was probably a temp file from some editor. I'm not sure how to fix it outside of allowing all files without extensions and including files previously ignored 🤔
maybe filter out hidden files instead of extensionless files? assuming those temp files are hidden
Kind hard to define hidden files across OSes. Maybe we should just allow extensionless files in colocated assets and we will see if we get more random files being added to builds
yeah that's fair. could just implement it cross platform with conditional compilation but it kinda sucks to pull in operating system restrictions that aren't absolutely needed. and it doesn't solve the root issue that some files are getting silently ignored in a way that isn't configurable. maybe could implement something like .gitignore with default rules?
actually tbh could probably literally just use .gitignore and ship a default one with new sites. if they aren't using git oh well theres an extra file floating around but that should capture "files we dont want served" in most cases.
I guess we could follow .gitignore on top of the current known temp files, that's a good idea
It would be nice to support related assets without extensions.
To add an additional example, I am hosting posts which sometimes contain source files and for convenience a Makefile
.
Yeah the commit introducing that was only thinking of weird tmp files, not valid usecases