Closed jmooring closed 2 months ago
What is a "index file" and where is the spec?
To reiterate, the problem is limited to Sass imported as a Hugo module. If the files exist in the OS file system, directory imports work as expected.
Thanks for putting my inane forum ramblings together into a bug @jmooring. I really appreciate it. 😄
Was tearing my hair out with this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Details: https://discourse.gohugo.io/t/51528/15
Applicable to Sass imported as a Hugo module, Hugo is unable to resolve directory paths to directory index files.
For example, this:
does not resolve to any of these:
foo/bar/_index.scss
foo/bar/_index.sass
foo/bar/_index.css
This affects both
@use
and@forward
rules. See:https://github.com/gohugoio/hugo/blob/28f621d4a73ca7e97e23b33cbf3780ddab188d24/resources/resource_transformers/tocss/dartsass/transform.go#L137
Based on experimentation, we should resolve to a file instead of a directory when both exist with same base name:
In the above, we should resolve to
foo.scss
instead offoo/_index.scss
.