Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resources.Concat fails with processed scss file on hugo 0.49 #5269

Closed
hanzei opened this issue Oct 1, 2018 · 1 comment · Fixed by #5274
Closed

resources.Concat fails with processed scss file on hugo 0.49 #5269

hanzei opened this issue Oct 1, 2018 · 1 comment · Fixed by #5274

Comments

@hanzei
Copy link

hanzei commented Oct 1, 2018

When running

{{ $bootstrap := resources.Get "/vendor/bootstrap/css/bootstrap.css" }}
{{ $style  := resources.Get "/scss/kaakeli.scss" | toCSS $cssOpts  }}

{{ $bundle := slice $bootstrap $style | resources.Concat "/css/bundle.css" }}

this fails with executing "partials/head/css.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat. But this did work with 0.48.

I suppose this bug come from e27fd4c.

If a example is need: Building https://github.com/vickylai/hugo-theme-introduction fails on Hugo 0.49.

@bep bep added the Bug label Oct 1, 2018
@bep bep added this to the v0.50 milestone Oct 1, 2018
@moorereason moorereason changed the title resources.Concat fails with procesed scss file on hugo 0.49 resources.Concat fails with processed scss file on hugo 0.49 Oct 1, 2018
@bep bep modified the milestones: v0.50, v0.49.1 Oct 2, 2018
bep added a commit to bep/hugo that referenced this issue Oct 2, 2018
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 gohugoio#5269
bep added a commit to bep/hugo that referenced this issue Oct 2, 2018
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 gohugoio#5269
bep added a commit to bep/hugo that referenced this issue Oct 2, 2018
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 gohugoio#5269
bep added a commit to bep/hugo that referenced this issue Oct 2, 2018
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 gohugoio#5269
@bep bep closed this as completed in #5274 Oct 2, 2018
bep added a commit that referenced this issue Oct 2, 2018
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
bep added a commit that referenced this issue Oct 10, 2018
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
kidynamit added a commit to rehive/docs-portal that referenced this issue Oct 10, 2018
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants