diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-04-20 11:05:35 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-04-20 15:09:12 +0200 |
commit | 004b6943906471cff0d0232040d24cff6cb89e6b (patch) | |
tree | 75d2492a0553a283c16a26cb5df9a178c5baa5ec /resources | |
parent | da6112fc65346d0f4e12b52d0580258cf02716c9 (diff) | |
download | hugo-004b6943906471cff0d0232040d24cff6cb89e6b.tar.gz hugo-004b6943906471cff0d0232040d24cff6cb89e6b.zip |
Fix partial rebuilds for SCSS fetched with GetMatch and similar
Fixes #12395
Diffstat (limited to 'resources')
-rw-r--r-- | resources/resource_transformers/tocss/scss/scss_integration_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/resources/resource_transformers/tocss/scss/scss_integration_test.go b/resources/resource_transformers/tocss/scss/scss_integration_test.go index c193ca8af..02e2b9200 100644 --- a/resources/resource_transformers/tocss/scss/scss_integration_test.go +++ b/resources/resource_transformers/tocss/scss/scss_integration_test.go @@ -327,3 +327,34 @@ Styles: {{ $r.RelPermalink }} b.AssertFileContent("public/index.html", "Styles: /scss/main.css") } + +func TestRebuildAssetGetMatch(t *testing.T) { + t.Parallel() + if !scss.Supports() { + t.Skip() + } + + files := ` +-- assets/scss/main.scss -- +b { + color: red; +} +-- layouts/index.html -- +{{ $r := resources.GetMatch "scss/main.scss" | toCSS }} +T1: {{ $r.Content }} + ` + + b := hugolib.NewIntegrationTestBuilder( + hugolib.IntegrationTestConfig{ + T: t, + TxtarString: files, + NeedsOsFS: true, + Running: true, + }).Build() + + b.AssertFileContent("public/index.html", `color: red`) + + b.EditFiles("assets/scss/main.scss", `b { color: blue; }`).Build() + + b.AssertFileContent("public/index.html", `color: blue`) +} |