parent
2db43f841c
commit
d913f46a8b
2 changed files with 33 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
||||||
package hugolib
|
package hugolib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -82,3 +83,33 @@ Page not found
|
||||||
Base:
|
Base:
|
||||||
Page not found`)
|
Page not found`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test404EditTemplate(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
files := `
|
||||||
|
-- hugo.toml --
|
||||||
|
baseURL = "http://example.com/"
|
||||||
|
disableLiveReload = true
|
||||||
|
[internal]
|
||||||
|
fastRenderMode = true
|
||||||
|
-- layouts/_default/baseof.html --
|
||||||
|
Base: {{ block "main" . }}{{ end }}
|
||||||
|
-- layouts/404.html --
|
||||||
|
{{ define "main" }}
|
||||||
|
Not found.
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
b := TestRunning(t, files)
|
||||||
|
|
||||||
|
b.AssertFileContent("public/404.html", `Not found.`)
|
||||||
|
|
||||||
|
b.EditFiles("layouts/404.html", `Not found. Updated.`).Build()
|
||||||
|
|
||||||
|
fmt.Println("Rebuilding")
|
||||||
|
b.BuildPartial("/does-not-exist")
|
||||||
|
|
||||||
|
b.AssertFileContent("public/404.html", `Not found. Updated.`)
|
||||||
|
}
|
||||||
|
|
|
@ -1274,7 +1274,7 @@ func (h *HugoSites) resolveAndResetDependententPageOutputs(ctx context.Context,
|
||||||
|
|
||||||
po.renderState = 0
|
po.renderState = 0
|
||||||
po.p.resourcesPublishInit = &sync.Once{}
|
po.p.resourcesPublishInit = &sync.Once{}
|
||||||
if r == identity.FinderFoundOneOfMany {
|
if r == identity.FinderFoundOneOfMany || po.f.Name == output.HTTPStatusHTMLFormat.Name {
|
||||||
// Will force a re-render even in fast render mode.
|
// Will force a re-render even in fast render mode.
|
||||||
po.renderOnce = false
|
po.renderOnce = false
|
||||||
}
|
}
|
||||||
|
@ -1310,6 +1310,7 @@ func (h *HugoSites) resolveAndResetDependententPageOutputs(ctx context.Context,
|
||||||
if !po.isRendered() {
|
if !po.isRendered() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, id := range changes {
|
for _, id := range changes {
|
||||||
checkedCounter.Add(1)
|
checkedCounter.Add(1)
|
||||||
if r := depsFinder.Contains(id, po.dependencyManagerOutput, 50); r > identity.FinderFoundOneOfManyRepetition {
|
if r := depsFinder.Contains(id, po.dependencyManagerOutput, 50); r > identity.FinderFoundOneOfManyRepetition {
|
||||||
|
|
Loading…
Add table
Reference in a new issue