mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
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
This commit is contained in:
parent
4989da653d
commit
59af05cabc
5 changed files with 38 additions and 2 deletions
|
@ -408,6 +408,9 @@ func (c *commandeer) loadConfig() error {
|
|||
|
||||
createMemFs := config.GetBool("renderToMemory")
|
||||
c.renderStaticToDisk = config.GetBool("renderStaticToDisk")
|
||||
// TODO(bep) we/I really need to look at the config set up, but to prevent changing too much
|
||||
// we store away the original.
|
||||
config.Set("publishDirOrig", config.GetString("publishDir"))
|
||||
|
||||
if createMemFs {
|
||||
// Rendering to memoryFS, publish to Root regardless of publishDir.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue