I am building a simple theme for blogging and project showcasing called breathe (https://github.com/BharatKalluri/breathe). It uses tailwind css as the css framework and purging is mandatory since tailwind without purging unused css is around 4MB.
I do see breathe (which is the theme) as a module from examplesite
Done
After cloning git@github.com:BharatKalluri/breathe.git and running
cd exampleSite
hugo --gc --theme=../..
I am facing a new error,
Start building sites …
Total in 38 ms
Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): resource "css/css/styles.css_2a8709d836a7705956d6e18ae3e69519" not found in file cache
{{ $styles := resources.Get "css/styles.css" }}
As far as I understand, resources.Get is relative to the assets directory in the theme, right? I am not sure why this does not work. Since I had a duplicate /css I decided to remove the css/ prefix in resources.Get just to experiment. Now I encountered a new error
Start building sites …
ERROR 2020/11/22 09:27:38 render of "page" failed: execute of template failed: template: _default/single.html:3:7: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bharatkalluri/Projects/breathe/layouts/partials/head.html:28:37": execute of template failed: template: partials/head.html:28:37: executing "partials/head.html" at <resources.PostCSS>: error calling PostCSS: no Resource provided in transformation
ERROR 2020/11/22 09:27:38 render of "home" failed: execute of template failed: template: index.html:3:7: executing "index.html" at <partial "head.html" .>: error calling partial: "/home/bharatkalluri/Projects/breathe/layouts/partials/head.html:28:37": execute of template failed: template: partials/head.html:28:37: executing "partials/head.html" at <resources.PostCSS>: error calling PostCSS: no Resource provided in transformation
ERROR 2020/11/22 09:27:38 render of "page" failed: execute of template failed: template: _default/single.html:3:7: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bharatkalluri/Projects/breathe/layouts/partials/head.html:28:37": execute of template failed: template: partials/head.html:28:37: executing "partials/head.html" at <resources.PostCSS>: error calling PostCSS: no Resource provided in transformation
ERROR 2020/11/22 09:27:38 render of "page" failed: execute of template failed: template: _default/single.html:3:7: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bharatkalluri/Projects/breathe/layouts/partials/head.html:28:37": execute of template failed: template: partials/head.html:28:37: executing "partials/head.html" at <resources.PostCSS>: error calling PostCSS: no Resource provided in transformation
Total in 34 ms
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:3:7: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bharatkalluri/Projects/breathe/layouts/partials/head.html:28:37": execute of template failed: template: partials/head.html:28:37: executing "partials/head.html" at <resources.PostCSS>: error calling PostCSS: no Resource provided in transformation
The error says no resource provided in transformation. I have the css file in /assets/css/styles.css right in the root of the theme dir. What am I missing?
breathe git:master ❯ hugo mod get -u ./... ✖ ✹ ✚ ✭
Update module in /home/bharatkalluri/Projects/breathe
Update module in /home/bharatkalluri/Projects/breathe/themes/hugo-starter-tailwind-basic
breathe git:master ❯ hugo mod graph --themesDir=../.. --source exampleSite ✖ ✹ ✚ ✭
project breathe
Looks like the module is not present, not sure why.
And when I run the example site, I still have the same error (As you were mentioning earlier, this is because of the module is not added)
breathe git:master ❯ hugo --gc --theme=../.. --source exampleSite ✖ ✹ ✚ ✭
Start building sites …
Total in 60 ms
Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): resource "css/css/styles.css_2a8709d836a7705956d6e18ae3e69519" not found in file cache
On a side note, I copied the setup (file structure, important pieces) from bep’s repo. Not essentially the module. The idea I had was to use that as a reference and migrate/work on my repo. Thereby learning how post processing and pipes work in hugo. If you could help me understand how assets and post processing works in hugo by answering questions in the first reply I gave to our conversation above, That would be really helpful