Changes to publishdir?


#1

Is it no longer possible to build the publish directory outside of site? For example, my config file has always had publishDir: "../dist" to publish my site alongside site rather than under it.

I find that if I use a relative path after installing v0.54 or v0.53 the path is ignored and I end up with my site built in site/public. I’ve reverted back to v0.52 in the meantime.

I’d like to avoid changing the location of my build directory because other portions of my build (SCSS -> CSS, Browserify, imagemin, etc.) expect the dist directory to be in a certain location.


#2

Using version 0.54.0 I tested this with the CLI flag:

hugo -d ../dist

And with a config.toml line:

publishDir = "../dist"

It worked both ways for me. I’m on macOS. What OS are you on?


#3

I’m on macOS 10.12.6.

It looks like the CLI flag --config may have changed slightly? Before, for my production build I ran:

hugo --config=site/config.yml --source=site

When I updated to v0.53 and beyond that caused my sit to build in site/public even though I had publishDir: "../dist" in my config file.

I updated my command to run as:

hugo --config=config.yml --source=site

Now everything is running as expected again. I guess the config flag is relying on the location of source files?

:man_shrugging:


#4

It all depends on which directory you run hugo from


#5

Correct, that hadn’t changed between versions. I always run the hugo command from the root of my project.

hugo --config=site/config.yml source=site <-- used to work, no longer does
hugo --config=config.yml source=site <-- this is how it’s configured after v0.53 to work in my case

├── docs
├── dist
├── site
|   ├── content
|   ├── assets
|   ├── layouts
|   ├── config.yml
|   ├── config.dev.yml
|   ├── config.staging.yml
|   └── etc...
├── package.json
├── package-lock.json
└── etc...