Files
hugo/tpl
Bjørn Erik Pedersen e2201ef15f tpl/collections: Fix handling of different interface types in Slice
In Hugo `0.49` we improved type support in `slice`. This has an unfortunate side effect in that `resources.Concat` now expects something that can resolve to `resource.Resources`.

This worked for most situations, but when you try to `slice` different `Resource` objects, you would be getting `[]interface {}` and not `resource.Resources`. And `concat` would fail:

```bash
error calling Concat: slice []interface {} not supported in concat.
```

This commit fixes that by simplifying the type checking logic in `Slice`:

* If the first item implements the `Slicer` interface, we try that
* If the above fails or the first item does not implement `Slicer`, we just return the `[]interface {}`

Fixes #5269
2018-10-10 12:21:42 +02:00
..
2017-09-28 16:53:18 +02:00
2018-09-07 08:25:51 +02:00
2017-11-25 18:38:33 +01:00
2018-09-07 08:25:51 +02:00
2018-09-07 08:25:51 +02:00
2018-07-06 17:51:38 +02:00
2018-08-06 09:54:26 +02:00