Bug? Local server environment gets deployed to server

I don’t know if this is intended behaviour, but…

If I use hugo server to run a local development server, and then do hugo deploy straight after that, then Hugo re-uploads the full site’s code, including RSS feeds, with direct links to http://localhost:1313...

This, of course, breaks things.

Expected behaviour would be that hugo deploy would never deploy the localhost environment variables.

Running my usual hugo && hugo deploy works as expected, with correct links to my domain.

Is this intended behaviour, a config file mistake, or a very stupid user? (It’s probably the latter)

The hugo server command will by default write and serve files from disk, but you can render to memory by using the --renderToMemory flag.

You alsl could use different publishDir when calling hugo server.

Or use hugo environments (development/production) to define that in config. With that you don’t need to be vigliant every time on the commandline

There’s a shorthand for that flag, so you can do

hugo server -M

Thanks. So for clarity - are we saying “this is the bug that causes this”, or “this is intended behaviour”?

I’m not sure it should work this way.

It’s intended behavior.