run: go install honnef.co/go/tools/cmd/staticcheck@latest
- if: matrix.os == 'ubuntu-latest'
name: Run staticcheck
- run: staticcheck ./...
+ run: |
+ export STATICCHECK_CACHE="${{ runner.temp }}/staticcheck"
+ staticcheck ./...
+ rm -rf ${{ runner.temp }}/staticcheck
- if: matrix.os != 'windows-latest'
name: Check
run: |
# See issue #11052. We limit the build to regular test (no -race flag) on Windows for now.
name: Test
run: |
- mage -v test;
+ mage -v test
+ go clean -i -testcache
env:
HUGO_BUILD_TAGS: extended,withdeploy
- - name: Build tags
- run: |
- go install -tags extended
- if: matrix.os == 'ubuntu-latest'
name: Build for dragonfly
run: |
go install
+ go clean -i -cache
env:
GOARCH: amd64
GOOS: dragonfly
b.AssertFileContent("public/en/s1/p1/index.html", "|color: red (en)|size: medium|") // fails: file contains "|color: red (en)|size: |"
b.AssertFileContent("public/de/s1/p1/index.html", "|color: red (de)|size: medium|")
}
+
+// Issue 14409
+func TestCascadeDraftTrue14409(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['rss','taxonomy','term']
+defaultContentLanguage = 'en'
+defaultContentLanguageInSubdir = true
+
+[languages.en]
+ weight = 1
+[languages.de]
+ weight = 2
+
+[[cascade]]
+ draft = true
+ [cascade.target.sites.matrix]
+ languages = ['en']
+-- content/_index.en.md --
+---
+title: home en
+draft: false
+---
+-- content/_index.de.md --
+---
+title: home de
+draft: false
+---
+-- content/s1/_index.en.md --
+---
+title: s1 en
+draft: false
+---
+-- content/s1/_index.de.md --
+---
+title: s1 de
+draft: false
+---
+-- content/s1/p1.en.md --
+---
+title: p1 en
+---
+-- content/s1/p1.de.md --
+---
+title: p1 de
+---
+-- layouts/all.html --
+{{ .Title }}
+`
+
+ b := Test(t, files)
+
+ b.AssertFileExists("public/de/index.html", true)
+ b.AssertFileExists("public/en/index.html", true)
+
+ b.AssertFileExists("public/de/s1/index.html", true)
+ b.AssertFileExists("public/en/s1/index.html", true)
+
+ b.AssertFileExists("public/de/s1/p1/index.html", true)
+ b.AssertFileExists("public/en/s1/p1/index.html", false)
+}
seenTerms: hmaps.NewMap[term, sitesmatrix.Vectors](),
droppedPages: hmaps.NewMap[*Site, []string](),
seenRootSections: seenRootSections,
- assembleSectionsInParallel: true,
+ assembleSectionsInParallel: !h.isRebuild(), // On partial rebuilds, there's potential data races with parallel section assembly.
pwRoot: pw,
rwRoot: rw,
}
return false
}
- var drop bool
if !site.shouldBuild(p) {
+ (&p.m.pageConfig.Build).Disable()
switch p.Kind() {
case kinds.KindHome, kinds.KindSection, kinds.KindTaxonomy:
- // We need to keep these for the structure, but disable
- // them so they don't get listed/rendered.
- (&p.m.pageConfig.Build).Disable()
+ // We need to keep these for the structure.
default:
- // Skip this page.
+ // Drop this page.
a.droppedPages.WithWriteLock(
func(m map[*Site][]string) error {
m[site] = append(m[site], s)
return nil
},
)
-
- drop = true
}
}
- if !drop && n == nil {
+ if n == nil {
if n2 == nil {
// Avoid creating a map for one node.
n2 = p
return err
}
for _, pkg := range pkgs {
- slashCount := strings.Count(pkg, "/")
+ /*slashCount := strings.Count(pkg, "/")
if slashCount > 1 {
continue
}
if pkg != "." {
pkg += "/..."
- }
+ }*/
if err := cmp.Or(CleanTest(), UninstallAll()); err != nil {
return err
}