-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
cleanDestinationDir in the config file is ignored sometimes #8433
Comments
I am unable to reproduce this error. When I create a new site and run hugo with the default config, it creates the two folders. When I modify the config file with the following: |
I can reproduce the problem. TLDR
The
The
The
The
The This may not be the only way to trigger the problem. |
So, this get skipped if there are no static directories. I suggest that we in that case just do a "walk and Remove" in the Line 653 in 3d5dbdc
|
hugo v0.81.0+extended linux/amd64 BuildDate=unknown
Specifically, it seems to be ignored if you have never used this option from CLI. After installing Hugo I just put
cleanDestinationDir: true
in config.yaml of the site I'm trying to make. However, the commandhugo
never deleted any directories or files that were becoming obsolete. For example, I first built the site with the default taxonomies, but later decided that I didn't need them, so I disabled them withHowever, after running
hugo
the directories "tags" and "categories" were still in "public". The same was the case with obsolete files/directories in "content". Only after I have commented the optioncleanDestinationDir: true
in the config.yaml and ranhugo --cleanDestinationDir
from the command line did Hugo build the "public" directory without the obsolete files/directories.After that, to test the issue, I uncommented the line in the config and ran just
hugo
. But now the option in config is working and the obsolete files are deleted from "public" as they should. It's like something has been initialized by runninghugo --cleanDestinationDir
once.The text was updated successfully, but these errors were encountered: