mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Merge commit '3c0036805d64fdd8290f1c4a31371780ff3ea365'
This commit is contained in:
@@ -203,23 +203,6 @@ Since Hugo generates a static website, your site can be hosted *anywhere* using
|
||||
Running `hugo` *does not* remove generated files before building. This means that you should delete your `public/` directory (or the publish directory you specified via flag or configuration file) before running the `hugo` command. If you do not remove these files, you run the risk of the wrong files (e.g., drafts or future posts) being left in the generated site.
|
||||
{{% /warning %}}
|
||||
|
||||
### Dev vs Deploy Destinations
|
||||
|
||||
Hugo does not remove generated files before building. An easy workaround is to use different directories for development and production.
|
||||
|
||||
To start a server that builds draft content (helpful for editing), you can specify a different destination; e.g., a `dev/` directory:
|
||||
|
||||
```
|
||||
hugo server -wDs ~/Code/hugo/docs -d dev
|
||||
```
|
||||
|
||||
When the content is ready for publishing, use the default `public/` dir:
|
||||
|
||||
```
|
||||
hugo -s ~/Code/hugo/docs
|
||||
```
|
||||
|
||||
This prevents draft content from accidentally becoming available.
|
||||
|
||||
[commands]: /commands/
|
||||
[config]: /getting-started/configuration/
|
||||
|
Reference in New Issue
Block a user