quarto-dev / quarto-dev/quarto-cli

include shortcode ignores project absolute path ("/") when called from a file inside a "_folder".

Open
#14,498 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug projects shortcodes
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

Hi,

Steps to reproduce

My folder structure:
_lessons
_exercises
articles

In "articles" I have several includes like:
{{< include "/_lessons/lesson1.qmd" >}}
{{< include "/_exercise/exercise1.qmd" >}}

This works like a charm. Include files are perfectly found.

BUT...

Problem: include does not work when I call them from a file inside "_lessons".
Example: in file _lessons/lesson2.qmd:
{{< include "/_exercise/exercise1.qmd" >}}

Actual behavior

The compiler/interpreter understand that the path is "_lessons/_exercise/exercise1.qmd" although I use "/" sign in the path. Therefore the file is not found.

This only happens in includes called inside files inside _folders.
Something related to the _folders makes this root path crashes and be ignored.

Expected behavior

I expect that the compiler understand that "/" inside include shortcode (wherever it is, even in "_folders") is understood as the project root.

Your environment

OS: Ubuntu 24.04
VsCode: 1.116.0
Quarto v: 1.9.37

Quarto 1.9.37
[✓] Checking environment information...
Quarto cache location: /home/chema/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.8.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.4.5: OK
Typst version 0.14.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.9.37
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)

[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2023

[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /usr/bin/google-chrome
Source: PATH

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........(None)

  Unable to locate an installed version of R.
  Install R from https://cloud.r-project.org/

[✓] Checking Python 3 installation....OK
Version: 3.12.3
Path: /home/chema/WORKSPACE/quarto/web_phy-che_privada/.venv/bin/python
Jupyter: 5.9.1
Kernels: python3, web_phy-che_privada

[✓] Checking Jupyter engine render....OK

[✓] Checking Julia installation...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported folder structure and include calls, then trace how the include shortcode resolves paths when invoked from a file inside a _folder. Done means a leading slash consistently resolves from the project root, including from nested files, and the existing reproduction succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.