From https://github.com/mcanouil/quarto-revealjs-coeos/issues/4, kind of thanks to @cderv I discovered an issue with the mechanism behind `format-resources`.

Everything listed in format-resources for a given format should be copied every time, but that's not at all the case.

## TL;DR

Repository: https://github.com/mcanouil/quarto-issues/tree/main/quarto-cli-1538

## Details

<details><summary>See some details</summary>

Let's define a fake template with some resources explicitly stated for each formats:

```yaml
title: Coeos Presentation Template
author: Mickaël CANOUIL
version: 1.0.0
contributes:
  formats:
    html:
      format-resources:
        - setup-ggplot2-coeos.R
        - about.qmd
        - cover.jpg
    pdf:
      format-resources:
        - setup-ggplot2-coeos.R
        - about.qmd
        - cover.jpg
```

Now, let's have a simple Quarto document:

````md
---
title: "A Title"
subtitle: "A Subtitle"
author: Mickaël Canouil, *Ph.D.*
format: demo-html
---

# Introduction

![](cover.jpg)

```{r}
source("setup-ggplot2-coeos.R")
```

{{< include about.qmd >}}
````

</details>

## Issues

- In PDF and HTML: `{{< include about.qmd >}}` does not trigger a copy thus a "not found" error.
- In PDF and HTML: `source("setup-ggplot2-coeos.R")` does not trigger a copy thus a "not found" error.
- In PDF: `![](cover.jpg)` triggers a copy of all resources (even when the other two are not called/used).
- In HTML: `![](cover.jpg)` does not trigger a copy leading again to a "not found" error.
dragonstyle
2022-07-26T18:57:37Z
mcanouil
v1.1
closed
[Quarto Extension] `format-resources` not properly detected and copied in both HTML and PDF formats
https://github.com/quarto-dev/quarto-cli/issues/1538