resource: Resources.ByType should return Resources - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 97c1866e322284dec46db6f3d235807507f5b69f
DIR parent 8969331f5be352939883074034adac6b7086ddc8
HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date: Sun, 7 Jan 2018 10:53:45 +0100
resource: Resources.ByType should return Resources
Currently it returns []Resource.
This way the invocations can be nested.
Fixes #4234
Diffstat:
M resource/resource.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/resource/resource.go b/resource/resource.go
@@ -55,8 +55,8 @@ type Resource interface {
// I.e. both pages and images etc.
type Resources []Resource
-func (r Resources) ByType(tp string) []Resource {
- var filtered []Resource
+func (r Resources) ByType(tp string) Resources {
+ var filtered Resources
for _, resource := range r {
if resource.ResourceType() == tp {