Open jtlandis opened 8 months ago
I was able to reproduce this and I think we have a decent amount of work to do in the way that we're resolving paths back into links. Beyond the path issues outlined here, I think we should also look closely at how we're splitting / joining paths, whether we are properly supporting ipynb
inputs, and any other assumptions about the presence of qmd
etc...
Most of the work appears to be confined to confuence-helper.ts#updateLinks()
, but I think it would make sense to tackle this post 1.4.
Also, I'm not sure if this is relevant to updating links in the parent, but I may have found a similar issue (I havent had the time to create a reproducible example yet).
This is what gather is the issue from a separate project. Attempting to refer to figures relative to one of the sub page .qmd
files. In the context of the above repex the issue may look something like the following:
├── index.qmd ├── _quarto.yml ├── README.md ├── reports ├── 2022-01.qmd ├── 2022-03.qmd └── figures/ └─ fig.png
so within 2022-01.qmd
there may be an image embedded like so
![](figures/fig.png)
This file would render fine as standard html or pdf output formats, but when using the quarto publish confluence
command, the resulting .xml
(within the _site/
directory) paths for the embedded figure cannot be found because it is expecting something from the quarto project root.
i.e., we would see:
<ri:attachment ri:filename="figures/fig.png" />
but in order to find the figure attachment correctly it should be
<ri:attachment ri:filename="reports/figures/fig.png" />
At the moment I have been able to remedy the issue by creating a post-render
bash script to correct the paths.
Bug description
I created a git repository to reproduce this issue. Please clone this git repo for a reprex.
It seems that sub pages cannot reference parent pages accurately with the
[text](PATH/To/QMD)
syntax specifically forquarto publish confluence
and when using../File.qmd
or/file.qmd
.It should be noted that this syntax works perfectly when viewing the rendered html pages from RStudio, but otherwise not.
Description of the Project structure
├── index.qmd ├── _quarto.yml ├── README.md ├── reports │ ├── 2022-01.qmd │ └── 2022-03.qmd └── section.qmd
Files and their links:
index.qmd
contains 4 links: one link to each of the sub pages and then 2 links tosection.qmd
.[go to section](section.qmd#Challenges and Opportunities)
links to the page but not the section :-1: .[New syntax](section.qmd#Challenges-and-Opportunities%5BinlineExtension%5D)
2022-01.qmd
contains 2 links, both trying to reference the top levelindex.qmd
except one using../index.qmd
and the other using/index.qmd
. :-1: Does not work but for different reasons.../index.qmd
syntax, the link is never created./index.qmd
syntax, A link is created but it redirects to the root uri on confluence, i.e. if your confluence site was namedsite.atlassian.net
then/index.qmd
syntax creates a link that redirects tohttps://site.atlassian.net/index.qmd
2022-03.qmd
contains only 1 link, still using../index.qmd
syntax except this file doesn't try and specify a section to jump to, still doesn't work :-1:Steps to reproduce
Expected behavior
No response
Actual behavior
No response
Your environment
Quarto check output