### Bug description

Tested with Quarto 0.9.629 (inside RStudio 2022.10.0 Build 9) and 0.9.607 (outside RStudio). 

Using an `index.qmd` as a non-project Quarto document:

````markdown
---
title: non-project document with variables
---

Apple cider donuts are {{< var reaction >}}.
````

This document expects values set in the `_variables.yml`:

```yaml
reaction: awesome
```

When rendering, we get a warning about the unknown variable:

```
quarto render index.qmd
# ...
# => WARNING: Unknown var reaction specified in a var shortcode.
```

The rendered HTML has the variable reference replaced by `?var:reaction`.

Creating an empty `_quarto.yml` is enough to cause this document to be processed as part of a project, and lets the variable get resolved.

```bash
touch _quarto.yml
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, self-contained, and reproducible example?
- [X] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
jjallaire
2022-06-29T20:45:53Z
aronatkins
bug
Future
closed
variables only available in projects
https://github.com/quarto-dev/quarto-cli/issues/1252