RMarkdown: CSS file generated by Sass with self_contained = FALSE not found

I am using my own new RMarkdown template as the basis for a file index.Rmd.
Document styling is set via an SCSS file styles.scss that is supplied with the template.

CSS not found with self_contained = FALSE

When I knit and render to HTML with self_contained = FALSE (which I prefer), the resulting CSS file is not found, and of course the styles are not able to be applied.
In the rendered HTML <head> I have the line

<link rel="stylesheet" type="text/css" href="index_files/sass493f389081fd4aaa931260f68a301bf8/style.min.css" />

so Sass is presumably parsing the SCSS file(s) OK - but this file is not actually being generated (or it is, but being immediately lost somehow).
The folder index_files is not even being created - I think that is a big clue that my template is not set up quite right. But I don't know what causes this.
Other CSS files created by Pandoc (?) such as

<link href="index_files/anchor-sections-1.0.1/anchor-sections.css" rel="stylesheet">

(I have anchor_sections = TRUE) are also not present/not found. I have checked that there should not be a permissions issue in the directory (index.html is being created OK anyhow).

It works OK with self_contained = TRUE

If I make single change and render with self_contained = TRUE then the CSS produced by Sass is included as minified data in the <head> like this:

<link rel="stylesheet" type="text/css" href="data:text/css, .... [lots of minified css]" />

and in this case the styles are of course found and applied just fine.

Can anyone suggest what I am doing wrong please?
Will generate a reprex somehow if needed!

I'm not what I did but this has sorted itself out now. The CSS files are being found OK.
It was probably a Sass caching issue.
Adding options(sass.cache = FALSE) to my RMarkdown setup chunk might have been the thing that fixed it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.