Disable creation of public folder

I see the default render to disk creates a public folder by default. Can this be set to opt out for users? Because for my content adaptors site, the folder is rather very large!

If you’re rendering to disk, you need to render it to disk.

Pardon? Not sure what that means.

You say you want to render to disk.

Where else would you want to render it if not in public?

Not really! What I mean is that hugo server generates a public folder by default since v0.123.0 which (I think) is because of rendering to disk. Could that be made optional? Especially coz my content adapters site is very resource hungry, so I can’t use renderToMemory.

I think we are failing to communicate.

When you run hugo server it renders to disk, specifically to the public directory.

When you run hugo server --renderToMemory it renders to memory, and does not create a public directory.

So, is the public folder in use here? I prefer the old behaviour of no public folder.

Yes, that’s where the files are rendered when you render to disk (i.e., when you don’t use the --renderToMemory command line flag).

If you don’t render to memory, you are rendering to disk. And when you render to disk, you render to the public directory.

Bummer! Guess I have to boost my RAM!

I don’t understand the problem with rendering to disk. You’ll consume less memory.

Space. Literary my HDD is nearly full and every free space counts to reduce lag! My content adaptors site with three remote data sources is already 3GB in size in public. Adding more soon (like 6-10) Might push that to even greater size. So, creating the public folder on hugo server is not ideal. This site is also very RAM and CPU hungry that it caused my PC to freeze 4 times in one night.

Get a bigger drive and render to disk. You will use less memory when rendering to disk.

Storage is cheap.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.