### Bug description

I want to re-use sections between different webpages on my website.

Following #3409 discussion, and in light of @dragonstyle's [answer](https://github.com/quarto-dev/quarto-cli/discussions/3409#discussioncomment-4195544), I went ahead and tried quarto's _include_ feature in a Quarto **_website_**. 

**Problem:** I cannot render the website. It throws an error:
> ERROR: Include directive failed.
> ...
> could not find file ...


Details About System
---
Quarto version: 1.2.269

<details>
  <summary>Session Info</summary>

  ``` r
  sessioninfo::session_info()
  #> - Session info ---------------------------------------------------------------
  #>  setting  value
  #>  version  R version 4.2.2 (2022-10-31 ucrt)
  #>  os       Windows 8.1 x64 (build 9600)
  #>  system   x86_64, mingw32
  #>  ui       RTerm
  #>  language (EN)
  #>  collate  English_United States.1252
  #>  ctype    English_United States.1252
  #>  tz       Asia/Jerusalem
  #>  date     2022-11-22
  #>  pandoc   2.19.2 @ C:/Program Files/RStudio/bin/quarto/bin/tools/ (via rmarkdown)
  #> 
  #> - Packages -------------------------------------------------------------------
  #>  package     * version date (UTC) lib source
  #>  cli           3.4.1   2022-09-23 [1] CRAN (R 4.2.1)
  #>  digest        0.6.30  2022-10-18 [1] CRAN (R 4.2.1)
  #>  evaluate      0.18    2022-11-07 [1] CRAN (R 4.2.2)
  #>  fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.2.2)
  #>  fs            1.5.2   2021-12-08 [1] CRAN (R 4.2.2)
  #>  glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.1)
  #>  highr         0.9     2021-04-16 [1] CRAN (R 4.2.2)
  #>  htmltools     0.5.3   2022-07-18 [1] CRAN (R 4.2.1)
  #>  knitr         1.40    2022-08-24 [1] CRAN (R 4.2.1)
  #>  lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.1)
  #>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.1)
  #>  reprex        2.0.2   2022-08-17 [1] CRAN (R 4.2.1)
  #>  rlang         1.0.6   2022-09-24 [1] CRAN (R 4.2.1)
  #>  rmarkdown     2.18    2022-11-09 [1] CRAN (R 4.2.2)
  #>  rstudioapi    0.14    2022-08-22 [1] CRAN (R 4.2.1)
  #>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.2)
  #>  stringi       1.7.8   2022-07-11 [1] CRAN (R 4.2.1)
  #>  stringr       1.4.1   2022-08-20 [1] CRAN (R 4.2.1)
  #>  withr         2.5.0   2022-03-03 [1] CRAN (R 4.2.1)
  #>  xfun          0.34    2022-10-18 [1] CRAN (R 4.2.2)
  #>  yaml          2.3.6   2022-10-18 [1] CRAN (R 4.2.1)
  #> 
  #>  [1] C:/Program Files/R/my_packages
  #>  [2] C:/Program Files/R/R-4.2.2/library
  #> 
  #> ------------------------------------------------------------------------------
  ```

</details>


Reproducible Example
---

### [A github repo](https://github.com/emmansh/test-quarto-include) with all the files from below.

### Step-by-step to reproduce the bug

#### 1. Create quarto website
1. RStudio -> File -> New Project -> New Directory -> Quarto Website
   <img width="268" alt="1" src="https://user-images.githubusercontent.com/18688877/200161174-5a5d2710-8652-408b-b74d-aa9a73084547.png">

#### 2. Set up two separate folders for blog posts & posts themselves
```shell
touch posts_bar.qmd
touch posts_foo.qmd
mkdir posts_bar
mkdir posts_foo
touch posts_bar/post_topic_a.qmd
touch posts_foo/post_topic_b.qmd
```

#### 3. Within files
##### _quarto.yml
```yml
project:
  type: website

website:
  title: "test-quarto-include"
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd
      - posts_bar.qmd
      - posts_foo.qmd

format:
  html:
    theme: cosmo
    css: styles.css
    toc: true

editor: visual
```

##### posts_bar.qmd
```yml
---
title: "Posts Bar"
listing: 
  contents: posts_bar
  type: grid
  sort: "date desc" 
  categories: true
---
```

##### posts_foo.qmd
```yml
---
title: "Posts Foo"
listing: 
  contents: posts_foo
  type: grid
  sort: "date desc" 
  categories: true
---
```

##### post_topic_a.qmd

<pre>

---
title: "Topic A"
---

# Intro
This posts discusses topic A, which is very interesting.

# Code Example
Here is some code about topic A:
```{r}
paste("a", "a", "a", sep = "_")
```

# Summary
Topic A is the most intriguing subject on Earth 

</pre>


##### post_topic_b.qmd

<pre>

---
title: "Topic B"
---

# Intro
This posts discusses topic B, which is boring.

# Should we borrow content from other topics?
Let's bring over some content about topic A, which is known to be interesting.
Specifically, there's a section with some code, which I believe is super cool.
Let's use Quarto's `include` feature:
(will it render?)
{{< include /posts_bar/post_topic_a.qmd#code-example >}}

What if we try using underscore in filename?
(will it render?)
{{< include /posts_bar/_post_topic_a.qmd#code-example >}}

</pre>

### 4. Render website & Error
In RStudio -> Build -> Render Website
![image](https://user-images.githubusercontent.com/18688877/203278720-c3f78b47-17eb-4d4f-a143-cc4183db9dde.png)
 
<br>

<details>
  <summary>Log from "Background Jobs" 👇</summary>
  
   ```
   Rendering:
   [1/6] about.qmd
   
   
   processing file: about.qmd
     |.......................                                               |  33%
     ordinary text without R code
   
     |...............................................                       |  67%
   label: unnamed-chunk-1
     |......................................................................| 100%
     ordinary text without R code
   
   
   output file: about.knit.md
   
   [2/6] index.qmd
   
   
   processing file: index.qmd
     |.......................                                               |  33%
     ordinary text without R code
   
     |...............................................                       |  67%
   label: unnamed-chunk-1
     |......................................................................| 100%
     ordinary text without R code
   
   
   output file: index.knit.md
   
   [3/6] posts_bar\post_topic_a.qmd
   
   
   processing file: post_topic_a.qmd
     |.......................                                               |  33%
     ordinary text without R code
   
     |...............................................                       |  67%
   label: unnamed-chunk-1
     |......................................................................| 100%
     ordinary text without R code
   
   
   output file: post_topic_a.knit.md
   
   [4/6] posts_bar.qmd
   [5/6] posts_foo\post_topic_b.qmd
   ERROR: Include directive failed.
     in file D:\test-quarto-include\posts_foo\post_topic_b.qmd, 
     could not find file D:\test-quarto-include\posts_bar\post_topic_a.qmd#code-example.
   ```

</details>


2022-11-22T09:51:13Z
emmansh
bug
closed
`{{< include >}}` in a Quarto website to re-use content between pages throws an error: `Include directive failed... could not find file ...`
https://github.com/quarto-dev/quarto-cli/issues/3421