diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-11 18:58:53 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-11 18:58:53 +0100 |
commit | db85e83403913cff4b8737b138932b28e5bf6160 (patch) | |
tree | 9c1e231dccbac72acbcdf1ec957636ae6789bc97 /resource/resource.go | |
parent | 1046e9363f2e382fd0b4aac838735ae4cbbebe5a (diff) |
resource: Make .Resources.GetByPrefix case insensitive
Fixes #4258
Diffstat (limited to 'resource/resource.go')
-rw-r--r-- | resource/resource.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/resource/resource.go b/resource/resource.go index c668a0efe..9cf9524b8 100644 --- a/resource/resource.go +++ b/resource/resource.go @@ -70,8 +70,10 @@ func (r Resources) ByType(tp string) Resources { // "logo" will match logo.png. It returns nil of none found. // In potential ambiguous situations, combine it with ByType. func (r Resources) GetByPrefix(prefix string) Resource { + prefix = strings.ToLower(prefix) for _, resource := range r { _, name := filepath.Split(resource.RelPermalink()) + name = strings.ToLower(name) if strings.HasPrefix(name, prefix) { return resource } |