Skip to content

How can I simplify relative paths in code cells? #12478

Answered by joelostblom
joelostblom asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @cderv, it seems like that option is working as expected for code cells! Now I have the following in my _quarto.yml:

project:
  type: website
  render:
    - modules
  execute-dir: project  # Allow regular code cells to access data without relative paths
  resources:
    - data  # Include data folder in built site

# Make data folder visible for live code cells
pyodide:
  resources:
    - data

I noticed that neither of these options seem to affect the paths of figures/images inside .qmd files, which still use relative references. I initially thought this would be the case when changing the working directory, but I realize it is only the execution / computation that is affected, wh…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@joelostblom
Comment options

@mcanouil
Comment options

mcanouil Apr 7, 2025
Collaborator

@cderv
Comment options

cderv Apr 8, 2025
Maintainer

@joelostblom
Comment options

Answer selected by joelostblom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants