-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add preserve_hidden_files configuration option #1985
Conversation
4193312
to
e7ccec0
Compare
I personally would like the feature where the public folder is kept and it's content are removed, but don't need the preservation of hidden files. Shouldn't be keeping the public folder be a seperate flag where the preserce_hidden flag implies keep_public? Another option would be make preserving the public folder default behavior, whcih ij turn would make the code here a bit simpler. |
I would prefer that too and implemented it this way initially, but @Keats reviewed that the original code path should be preserved when the option is not set. My guess is to keep backwards compatibility in cases the folder is watched by other tools. |
That makes sense! So would it be a good option to add a separate flag to keep the public folder? |
What's the usecase for wanting the public folder preserved but empty? |
I am running zola as a docker image to rebuild the site on file-change. However, things tend to break when a folder mounted to a docker image is removed. Hence, by removing the files rather than the entire folder, the public folder itself can be mounted. Currently I am running a |
what are your thoughts about this @Keats ? |
I think the current PR is fine, I'm just wondering about the naming. Files starting with |
How about renaming the option to "preserve_dotfiles" instead of "preserve_hidden_files"? Thats a term that is associated with configuration files, and does not imply anything about visibility. Is also a little shorter |
|
Okay, sounds good to me! I'll change it |
Looks like you need to do a manual rebase from the next branch |
8308fa2
to
4b83e30
Compare
ok, done |
So i believe just turning on this option will mean that the public folder will not be deleted, solving a few people issues as well. |
Nice :) I should probably add this behaviour to to the documentation to make it more discoverable. Something like Edit: done. |
Thanks! |
This PR introduces a
preserve_hidden_files
configuration option. When this option is set to true, zola preserves all hidden ( starting with.
) files and folders in the output directory when building the site.It also changes that all files inside the output directory, but not the folder itself are deleted.
closes #1976 when merged.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: