### Bug description

Thanks very much to @dragonstyle for https://github.com/quarto-dev/quarto-cli/pull/5055.

Listing does **not** work as expected when use provide relative file path.

[Files for reproduction](https://github.com/quarto-dev/quarto-cli/files/11212420/5165.zip)

When I provide a YAML file to `listing.contents` like in

```
---
title: "About"
listing:
  id: about-listing
  contents: listing.yml
---

About this site

:::{#about-listing}
:::
```

where `listing.yml` is, **note the relative path**,

```
- path: ../post.md
```

I get a page without the listing:

![Screenshot of render page without listing](https://user-images.githubusercontent.com/1506457/231488087-55fddf6c-3ba7-47fc-9c60-5814d03dda82.png)

The expected result, obtained when avoiding relative path, is

![Screenshot of render page with listing](https://user-images.githubusercontent.com/1506457/231488934-c1382019-545f-42d0-a634-3848375ecb0d.png)

## Debug Information

```
[2/3] about/index.qmd
[listing] Reading listing 'about-listing' from /tmp/tmp.VQtWUWtryM/about/index.qmd
[listing] Contents: listing.yml
[listing] matches 1 files:
[listing] Reading YAML file /tmp/tmp.VQtWUWtryM/about/listing.yml
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/template.patched from /tmp/quarto-session94573f88/196afac0/191ef397/template.patched
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/metadata.html from /tmp/quarto-session94573f88/196afac0/191ef397/metadata.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/styles.html from /tmp/quarto-session94573f88/196afac0/191ef397/styles.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/title-block.html from /tmp/quarto-session94573f88/196afac0/191ef397/title-block.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/title-metadata.html from /tmp/quarto-session94573f88/196afac0/191ef397/title-metadata.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/title-block.html from /tmp/quarto-session94573f88/196afac0/191ef397/title-block.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/title-metadata.html from /tmp/quarto-session94573f88/196afac0/191ef397/title-metadata.html
[INFO] Loaded /tmp/quarto-session94573f88/196afac0/191ef397/toc.html from /tmp/quarto-session94573f88/196afac0/191ef397/toc.html
[trace] Parsed [Plain [Str "long"]] at line 1
[trace] Parsed [Plain [Str "en"]] at line 1
[trace] Parsed [Plain [Str "listing.yml"]] at line 1
[trace] Parsed [Plain [Str "about-listing"]] at line 1
[trace] Parsed [Plain [Str "true"]] at line 1
[trace] Parsed [Plain [Str "1.3.319"]] at line 1
[trace] Parsed [Plain [Str "cosmo"]] at line 1
[trace] Parsed [Plain [Str "About"]] at line 1
[trace] Parsed [Plain [Str "On",Space,Str "this",Space,Str "page"]] at line 1
[trace] Parsed [] at line 5
[trace] Parsed [Para [Str "About",Space,Str "this",Space,Str "site"]] at line 7
[trace] Parsed [Div ("about-listing",[],[]) []] at line 13
[trace] Parsed [Para [Span ("",["hidden"],[("render-id","quarto-int-sidebar at line 20
[trace] Parsed [Div ("quarto-navigation-envelope",["hidden"],[]) [Para [Spa at line 23
[trace] Parsed [Para [Span ("",["hidden"],[("render-id","quarto-enable-math at line 26
[trace] Parsed [] at line 29
[trace] Parsed [Para [RawInline (Format "html") "<a href=\"../post.md\">",S at line 34
[trace] Parsed [Div ("",["thumbnail"],[]) [Para [RawInline (Format "html")  at line 34
[trace] Parsed [] at line 35
[trace] Parsed [Plain [RawInline (Format "html") "<a href=\"../post.md\">"] at line 36
[trace] Parsed [Div ("",["delink","listing-description"],[]) []] at line 37
[trace] Parsed [] at line 38
[trace] Parsed [Plain [RawInline (Format "html") "</a>"]] at line 38
[trace] Parsed [Div ("",["body"],[]) [Plain [RawInline (Format "html") "<a  at line 38
[trace] Parsed [] at line 39
[trace] Parsed [Plain [RawInline (Format "html") "<a href=\"../post.md\">", at line 40
[trace] Parsed [Div ("",["metadata"],[]) [Plain [RawInline (Format "html")  at line 40
[trace] Parsed [] at line 41
[trace] Parsed [Div ("",["quarto-post","image-right"],[("data-index","0")]) at line 41
[trace] Parsed [] at line 42
[trace] Parsed [Div ("",["list","quarto-listing-default"],[]) [Div ("",["qu at line 44
[trace] Parsed [Plain [Str "No",Space,Str "matching",Space,Str "items"]] at line 44
[trace] Parsed [Div ("",["listing-no-matching","d-none"],[]) [Plain [Str "N at line 44
[trace] Parsed [] at line 46
[trace] Parsed [Div ("",["hidden"],[("render-id","pipeline-listing-about-li at line 48
[trace] Parsed [Div ("quarto-listing-pipeline",["hidden"],[]) [Para [Span ( at line 52
[trace] Parsed [Para [Span ("",["hidden"],[("render-id","quarto-metatitle") at line 59
[trace] Parsed [Div ("quarto-meta-markdown",["hidden"],[]) [Para [Span ("", at line 63
[INFO] Running filter /opt/quarto/share/filters/main.lua
[INFO] Completed filter /opt/quarto/share/filters/main.lua in 45 ms
```

## Environment information

Output of `quarto check`:

```
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.319
      Path: /opt/quarto/bin

Loaded deno-dom-native
(\) Checking basic markdown render....[trace] Parsed [Plain [Str "long"]] at line 1
[trace] Parsed [Plain [Str "en"]] at line 1
[trace] Parsed [Plain [Str "true"]] at line 1
[trace] Parsed [Plain [Str "1.3.319"]] at line 1
[trace] Parsed [Plain [Str "Title"]] at line 1
[trace] Parsed [Plain [Str "Table",Space,Str "of",Space,Str "contents"]] at line 1
[trace] Parsed [] at line 5
[trace] Parsed [Header 2 ("header",[],[]) [Str "Header"]] at line 8
[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /usr/bin/python3
      Jupyter: 5.2.0
      Kernels: python3

(-) Checking Jupyter engine render....Traceback (most recent call last):
  File "/opt/quarto/share/jupyter/jupyter.py", line 21, in <module>
    from notebook import notebook_execute, RestartKernel
  File "/opt/quarto/share/jupyter/notebook.py", line 18, in <module>
    from nbclient import NotebookClient
ModuleNotFoundError: No module named 'nbclient'
[✓] Checking Jupyter engine render....OK
```

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
dragonstyle
2023-04-12T14:29:40Z
rgaiacs
bug
v1.3
closed
Make Listing Source from YAML file more robust by handling relative file path
https://github.com/quarto-dev/quarto-cli/issues/5165