From 59af05cabc74e381afb62e624afa5542a9ae8d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 22 Dec 2022 09:43:53 +0100 Subject: Add HUGO_PUBLISHDIR to the Node environment So you can do `process.env.HUGO_PUBLISHDIR` in your `postcss.config.js` to figure out where Hugo publishes its files. Note that the value will always be an absolute file path and will point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: ``` hugo server --renderToDisk hugo server --renderStaticToDisk ``` Fixes #10554 --- hugolib/config.go | 1 + 1 file changed, 1 insertion(+) (limited to 'hugolib/config.go') diff --git a/hugolib/config.go b/hugolib/config.go index 9ccb87014..8e73a35ec 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -242,6 +242,7 @@ func (l configLoader) applyConfigDefaults() error { "watch": false, "resourceDir": "resources", "publishDir": "public", + "publishDirOrig": "public", "themesDir": "themes", "buildDrafts": false, "buildFuture": false, -- cgit v1.2.3