I am trying to set up a custom scss sheet per post. I can retrieve the variable but resources.Get could not read the formatted string as scss for conversion.
This is how I set up my frontmatter:
---
title: Title
description: some description
languageCode: en
slug: FT000
customCss: FT000.scss
---
mmh, maybe I just got your problem wrong - do you say {{ $customCssPath := printf "css/blog/%s" .Params.customCss }} fails?
If so there must be something strange in your source . For that we would need to see the code. a stripped down non-working example in a repo would be fine.
I would say NO, you are not. Just installing dart-sass is not enough. that’s why I posted the link to the documentation.
transpiler
(string) The transpiler to use, either libsass(default) or dartsass. Hugo’s extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the installation instructions below.
Blackbox idea here: ALL scss generation fails if ONE content file does not have .Params.customCss. The way this line is written Hugo expects all frontmatters to have this variable. Better would be:
{{ with .Params.customCss }}
{{ $customCssPath := printf "css/blog/%s" . }}
... do your stylesheet generation and link here
{{ end }}
Also: is .Params at that point really what we expect it to be or is the Dot taken by another range or in a partial?