Skip to content

Commit

Permalink
hugolib: Add a test for overriding _internal templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 28, 2024
1 parent aa0f66b commit 371246d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hugolib/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,3 +706,17 @@ a: {{ $a }}

b.AssertFileContent("public/index.html", `a: [a b c]`)
}

func TestOverrideInternalTemplate(t *testing.T) {
files := `
-- hugo.toml --
baseURL = "https://example.org"
-- layouts/index.html --
{{ template "_internal/google_analytics_async.html" . }}
-- layouts/_internal/google_analytics_async.html --
Overridden.
`
b := Test(t, files)

b.AssertFileContent("public/index.html", "Overridden.")
}

0 comments on commit 371246d

Please sign in to comment.