Does hugo server remove stale files from public/ when content is deleted?
I’m seeing what appears to be stale output while using hugo server, and I’d like to know whether this is expected behavior or if I’m missing a configuration option.
Environment
-
Hugo server
-
Linux Mint
-
Start command:
HUGO_ENVIRONMENT=development hugo server --disableFastRender
Test
- Create a content directory:
content/en/house/acmecorp/
-
Hugo generates the website correctly.
-
Delete the entire directory:
content/en/house/acmecorp/
- Verify it is really gone:
find content -name acmecorp
returns nothing.
- However, the generated directory still exists:
find public -name acmecorp
returns:
public/house/acmecorp
- Visiting
http://localhost:1313/house/acmecorp/
still displays the previously generated website.
If I stop the server, delete everything from public/, and restart hugo server, the URL correctly returns “Page Not Found”.
Question
Is this the expected behavior of hugo server?
Should stale output under public/ remain after the corresponding content has been deleted?
Or is there a recommended option or workflow that automatically removes obsolete generated files while the development server is running?
I’m trying to determine whether I should manually clean public/, or whether Hugo provides a built-in solution for this use case.