Open bep opened 1 year ago
I tried the --renderStaticToDisk
flag today, but it does not work for me. My use case is a bit hacky, so maybe you could chime in as well. Hugo does not have support for post-build tasks yet, and to avoid maintaining build recipes for each site, I wrote a custom PostCSS plugin in the theme to incorporate the build task.
Here's a short rundown:
HUGO_PUBLISHDIR
and find appropriate source filesexec
While this is a bit hacky, it allows me to specify the plugin in the theme (not currently working on a module level: https://discourse.gohugo.io/t/how-to-make-postcss-recognize-hugo-module-imports/44633/2) and have all websites inherit the build recipe without needing to do anything extra.
In the context of this issue, I tried this, but in the server mode, I could not get the PDFs to generate with PostCSS in the public directory at all. It works with the non-server hugo
command. Please let me know if you need further information.
See #10554
Any
PostCSS
post-processing viaresources.PostProcess
needs to work on files on disk. When runninghugo server
without options, everything is rendered and served from disk. You can dohugo server --renderToDisk
, but that throws away the performance benefit of doing everything in memory just to handle a couple of CSS files.We did, however, introduce a new flag recently:
I haven't tested it, but using that flag today should also work fine for the
resources.PostProcess
case. It will also write/serve files in/static
to disk, but that's probably fine in most cases.This issue is to track whether we can do better, possible detect the above situation and make
resources.PostProcess
use this hybrid file system, I'm not sure./cc @UtkarshVerma