Skip to content

Add Resources.ByMediaType #12874

@bep

Description

@bep

Working in improving the JS build situation, I'm ending up in a situation where I get a Resources slice that contains both Javascript and CSS.

I could filter this with where, but since this will be such a common construct, I think we need to add another By* method.

We have Resources.ByType which is (a little confusingly) filtering by the media type's main type.

I suggest we add:

Resources.ByMediaType so {{ $resources.ByMediaType "text/css" }} would return what's expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions