aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-12-16 08:34:17 +0100
committerBjørn Erik Pedersen <[email protected]>2024-12-16 11:52:18 +0100
commit565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb (patch)
treed7a8e84098dbca1dce0d52ab0941178949532a19 /hugolib
parent48dd6a918a0ef070819ef80d59b2553bc99e2964 (diff)
downloadhugo-565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb.tar.gz
hugo-565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb.zip
js: Fix js.Batch for multihost setups
Note that this is an unreleased feature. Fixes #13151
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/paths/paths.go2
-rw-r--r--hugolib/site.go8
2 files changed, 8 insertions, 2 deletions
diff --git a/hugolib/paths/paths.go b/hugolib/paths/paths.go
index 397dba3f8..60ec873f9 100644
--- a/hugolib/paths/paths.go
+++ b/hugolib/paths/paths.go
@@ -67,7 +67,7 @@ func New(fs *hugofs.Fs, cfg config.AllProvider) (*Paths, error) {
var multihostTargetBasePaths []string
if cfg.IsMultihost() && len(cfg.Languages()) > 1 {
for _, l := range cfg.Languages() {
- multihostTargetBasePaths = append(multihostTargetBasePaths, l.Lang)
+ multihostTargetBasePaths = append(multihostTargetBasePaths, hpaths.ToSlashPreserveLeading(l.Lang))
}
}
diff --git a/hugolib/site.go b/hugolib/site.go
index f73bd2517..4e2497ee1 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -42,6 +42,7 @@ import (
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/hugolib/doctree"
"github.com/gohugoio/hugo/hugolib/pagesfromdata"
+ "github.com/gohugoio/hugo/internal/js/esbuild"
"github.com/gohugoio/hugo/internal/warpc"
"github.com/gohugoio/hugo/langs/i18n"
"github.com/gohugoio/hugo/modules"
@@ -205,6 +206,12 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) {
return nil, err
}
+ batcherClient, err := esbuild.NewBatcherClient(firstSiteDeps)
+ if err != nil {
+ return nil, err
+ }
+ firstSiteDeps.JSBatcherClient = batcherClient
+
confm := cfg.Configs
if err := confm.Validate(logger); err != nil {
return nil, err
@@ -313,7 +320,6 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) {
return li.Lang < lj.Lang
})
- var err error
h, err = newHugoSites(cfg, firstSiteDeps, pageTrees, sites)
if err == nil && h == nil {
panic("hugo: newHugoSitesNew returned nil error and nil HugoSites")