mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Revert "Revert "Allow rendering static files to disk and dynamic to memory in server mode""
This reverts commit 64b7b7a897
.
This commit is contained in:
@@ -33,9 +33,10 @@ func newPagesProcessor(h *HugoSites, sp *source.SourceSpec) *pagesProcessor {
|
||||
procs := make(map[string]pagesCollectorProcessorProvider)
|
||||
for _, s := range h.Sites {
|
||||
procs[s.Lang()] = &sitePagesProcessor{
|
||||
m: s.pageMap,
|
||||
errorSender: s.h,
|
||||
itemChan: make(chan any, config.GetNumWorkerMultiplier()*2),
|
||||
m: s.pageMap,
|
||||
errorSender: s.h,
|
||||
itemChan: make(chan interface{}, config.GetNumWorkerMultiplier()*2),
|
||||
renderStaticToDisk: h.Cfg.GetBool("renderStaticToDisk"),
|
||||
}
|
||||
}
|
||||
return &pagesProcessor{
|
||||
@@ -118,6 +119,8 @@ type sitePagesProcessor struct {
|
||||
ctx context.Context
|
||||
itemChan chan any
|
||||
itemGroup *errgroup.Group
|
||||
|
||||
renderStaticToDisk bool
|
||||
}
|
||||
|
||||
func (p *sitePagesProcessor) Process(item any) error {
|
||||
@@ -162,7 +165,12 @@ func (p *sitePagesProcessor) copyFile(fim hugofs.FileMetaInfo) error {
|
||||
|
||||
defer f.Close()
|
||||
|
||||
return s.publish(&s.PathSpec.ProcessingStats.Files, target, f)
|
||||
fs := s.PublishFs
|
||||
if p.renderStaticToDisk {
|
||||
fs = s.PublishFsStatic
|
||||
}
|
||||
|
||||
return s.publish(&s.PathSpec.ProcessingStats.Files, target, f, fs)
|
||||
}
|
||||
|
||||
func (p *sitePagesProcessor) doProcess(item any) error {
|
||||
|
Reference in New Issue
Block a user