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

Handle themes in the new file cache (images, assets) #5460

Closed
onedrawingperday opened this issue Nov 22, 2018 · 6 comments · Fixed by #5462
Closed

Handle themes in the new file cache (images, assets) #5460

onedrawingperday opened this issue Nov 22, 2018 · 6 comments · Fixed by #5462
Milestone

Comments

@onedrawingperday
Copy link
Contributor

Following the discussion from gohugoio/hugoThemes#506 (comment) I am opening this issue to report that I am seeing the exact same behavior described over here: #5226 (comment)

Reverting commit 5df2b79 seems to fix the issue.

CC / @digitalcraftsman

@bep
Copy link
Member

bep commented Nov 22, 2018

How can that commit be a problem for the "themes site"? It is not released?

@onedrawingperday onedrawingperday changed the title Commit 5df2b79 is causing problems with Hugo Pipes Assets on the Themes website Commit 5df2b79 is causing problems when testing Theme Submissions while on Hugo 0.52 Dev Nov 22, 2018
@bep
Copy link
Member

bep commented Nov 22, 2018

OK, now I see what that issue was all about -- I think ...

@bep bep changed the title Commit 5df2b79 is causing problems when testing Theme Submissions while on Hugo 0.52 Dev Check relpermalink vs sub-path vs resource transformations Nov 22, 2018
@bep bep added this to the v0.52 milestone Nov 22, 2018
@onedrawingperday
Copy link
Contributor Author

onedrawingperday commented Nov 22, 2018

Steps to reproduce.

  • Clone Hugo Themes repo
  • git submodule add https://github.com/desimone/evie-hugo
  • cd _script/
  • ./generateThemeSite.sh > errors.txt
  • ERROR log: ==== PROCESSING evie-hugo ====== Building site for theme evie-hugo using its own exampleSite to ../themeSite/static/theme/evie-hugo/ ERROR 2018/11/22 21:05:53 error: failed to transform resource: TOCSS: failed to transform "css/style.css" (text/css): this feature is not available in your current Hugo version FAILED to create exampleSite for evie-hugo

Hugo version

Hugo Static Site Generator v0.52-DEV-E82B2DC8:CHROMA-1B755A9 linux/amd64 BuildDate: 2018-11-22T20:58:37+0200

Here is the relevant commit in the Evie Theme's repository desimone/evie-hugo@9caa8e1

From layouts/partials/header.html

{{ $style := slice $e1 $e2 $e3 $e4 $e5 $e6 $e7 $e8 $e10 $e11 $e12 $e13 $e14 $e15 $e16 $e17 $e18 $e19 $e20 $e21 $c | resources.Concat "css/style.css" | resources.ToCSS | minify }}
<link rel="stylesheet" href="{{ $style.Permalink }}" />
<link rel="stylesheet" type="text/css" href="{{ $style.RelPermalink }}" />

@bep
Copy link
Member

bep commented Nov 22, 2018

OK, I see what's happening. Will fix.

@bep
Copy link
Member

bep commented Nov 23, 2018

Note that for the "evie Hugo" example, this is not related to any "base path", this was broken in my recently "cache consolidation" PR.

We cache resources, and in case "feature is not available" (aka Netlify), we fall back to cached SCSS result. The cache consolidation did not consider ... themes, which in most cases would not be visible (you just recache it the first time you run Hugo on the site itself), but not so for the "demo site".

I will fix this, just thought I should add a little context. The cache consolidation code is not in a released Hugo version, and the "relpermalink vs canonify" was an obvious bugfix.

@bep bep changed the title Check relpermalink vs sub-path vs resource transformations Handle themes in the new file cache (images, assets) Nov 23, 2018
bep added a commit to bep/hugo that referenced this issue Nov 23, 2018
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites.

Fixes gohugoio#5460
bep added a commit to bep/hugo that referenced this issue Nov 23, 2018
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites.

Fixes gohugoio#5460
@bep bep closed this as completed in #5462 Nov 23, 2018
bep added a commit that referenced this issue Nov 23, 2018
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites.

Fixes #5460
@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 23, 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