mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
parent
7b69218489
commit
5ab38de363
4 changed files with 30 additions and 24 deletions
|
@ -577,23 +577,25 @@ disableKinds = ['page','section','rss','sitemap','taxonomy','term']
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = 'assets'
|
source = 'assets'
|
||||||
target = 'assets'
|
target = 'assets'
|
||||||
|
[[module.mounts]]
|
||||||
[[module.imports]]
|
|
||||||
path = "github.com/gohugoio/hugoTestModule2"
|
|
||||||
|
|
||||||
[[module.imports.mounts]]
|
|
||||||
source = "miscellaneous/sass"
|
source = "miscellaneous/sass"
|
||||||
target = "assets/sass"
|
target = "assets/sass"
|
||||||
-- go.mod --
|
|
||||||
module hugo-github-issue-12849
|
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
{{ $opts := dict "transpiler" "dartsass" "outputStyle" "compressed" }}
|
{{ $opts := dict "transpiler" "dartsass" "outputStyle" "compressed" }}
|
||||||
{{ (resources.Get "sass/main.scss" | toCSS $opts).Content }}
|
{{ (resources.Get "sass/main.scss" | toCSS $opts).Content }}
|
||||||
-- assets/sass/main.scss --
|
-- assets/sass/main.scss --
|
||||||
@use "foo"; // directory with index file from OS file system
|
@use "foo1"; // directory with _index file from OS file system
|
||||||
@use "bar"; // directory with index file from module mount
|
@use "bar1"; // directory with _index file from module mount
|
||||||
-- assets/sass/foo/_index.scss --
|
@use "foo2"; // directory with index file from OS file system
|
||||||
.foo {color: red;}
|
@use "bar2"; // directory with index file from module mount
|
||||||
|
-- assets/sass/foo1/_index.scss --
|
||||||
|
.foo1 {color: red;}
|
||||||
|
-- miscellaneous/sass/bar1/_index.scss --
|
||||||
|
.bar1 {color: blue;}
|
||||||
|
-- assets/sass/foo2/index.scss --
|
||||||
|
.foo2 {color: red;}
|
||||||
|
-- miscellaneous/sass/bar2/index.scss --
|
||||||
|
.bar2 {color: blue;}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.NewIntegrationTestBuilder(
|
||||||
|
@ -603,7 +605,7 @@ module hugo-github-issue-12849
|
||||||
TxtarString: files,
|
TxtarString: files,
|
||||||
}).Build()
|
}).Build()
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", ".foo{color:red}.bar{color:green}")
|
b.AssertFileContent("public/index.html", ".foo1{color:red}.bar1{color:blue}.foo2{color:red}.bar2{color:blue}")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIgnoreDeprecationWarnings(t *testing.T) {
|
func TestIgnoreDeprecationWarnings(t *testing.T) {
|
||||||
|
|
|
@ -170,6 +170,7 @@ func (t importResolver) CanonicalizeURL(url string) (string, error) {
|
||||||
"_%s.sass", "%s.sass",
|
"_%s.sass", "%s.sass",
|
||||||
"_%s.css", "%s.css",
|
"_%s.css", "%s.css",
|
||||||
"%s/_index.scss", "%s/_index.sass",
|
"%s/_index.scss", "%s/_index.sass",
|
||||||
|
"%s/index.scss", "%s/index.sass",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -432,23 +432,25 @@ disableKinds = ['page','section','rss','sitemap','taxonomy','term']
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = 'assets'
|
source = 'assets'
|
||||||
target = 'assets'
|
target = 'assets'
|
||||||
|
[[module.mounts]]
|
||||||
[[module.imports]]
|
|
||||||
path = "github.com/gohugoio/hugoTestModule2"
|
|
||||||
|
|
||||||
[[module.imports.mounts]]
|
|
||||||
source = "miscellaneous/sass"
|
source = "miscellaneous/sass"
|
||||||
target = "assets/sass"
|
target = "assets/sass"
|
||||||
-- go.mod --
|
|
||||||
module hugo-github-issue-12849
|
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
{{ $opts := dict "transpiler" "libsass" "outputStyle" "compressed" }}
|
{{ $opts := dict "transpiler" "libsass" "outputStyle" "compressed" }}
|
||||||
{{ (resources.Get "sass/main.scss" | toCSS $opts).Content }}
|
{{ (resources.Get "sass/main.scss" | toCSS $opts).Content }}
|
||||||
-- assets/sass/main.scss --
|
-- assets/sass/main.scss --
|
||||||
@import "foo"; // directory with index file from OS file system
|
@import "foo1"; // directory with _index file from OS file system
|
||||||
@import "bar"; // directory with index file from module mount
|
@import "bar1"; // directory with _index file from module mount
|
||||||
-- assets/sass/foo/_index.scss --
|
@import "foo2"; // directory with index file from OS file system
|
||||||
.foo {color: red;}
|
@import "bar2"; // directory with index file from module mount
|
||||||
|
-- assets/sass/foo1/_index.scss --
|
||||||
|
.foo1 {color: red;}
|
||||||
|
-- miscellaneous/sass/bar1/_index.scss --
|
||||||
|
.bar1 {color: blue;}
|
||||||
|
-- assets/sass/foo2/index.scss --
|
||||||
|
.foo2 {color: red;}
|
||||||
|
-- miscellaneous/sass/bar2/index.scss --
|
||||||
|
.bar2 {color: blue;}
|
||||||
`
|
`
|
||||||
|
|
||||||
b := hugolib.NewIntegrationTestBuilder(
|
b := hugolib.NewIntegrationTestBuilder(
|
||||||
|
@ -458,5 +460,5 @@ module hugo-github-issue-12849
|
||||||
TxtarString: files,
|
TxtarString: files,
|
||||||
}).Build()
|
}).Build()
|
||||||
|
|
||||||
b.AssertFileContent("public/index.html", ".foo{color:red}.bar{color:green}")
|
b.AssertFileContent("public/index.html", ".foo1{color:red}.bar1{color:blue}.foo2{color:red}.bar2{color:blue}")
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@ func (t *toCSSTransformation) Transform(ctx *resources.ResourceTransformationCtx
|
||||||
"_%s.scss", "%s.scss",
|
"_%s.scss", "%s.scss",
|
||||||
"_%s.sass", "%s.sass",
|
"_%s.sass", "%s.sass",
|
||||||
"%s/_index.scss", "%s/_index.sass",
|
"%s/_index.scss", "%s/_index.sass",
|
||||||
|
"%s/index.scss", "%s/index.sass",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue