How are metadata paths resolved? #8423
Replies: 1 comment 4 replies
-
Howdy! I. Slide ListingFor part I, using our latest builds (which should be pretty the shipping 1.4 release, though I'm a little ahead of that) - I cloned your repo and just ran it and things seemed ok to me): I took a quick peak through the changes in 1.4 and don't necessarily see one that I think will fix this, but there are bunch of improvements to listing handling so wouldn't be totally shocked if we changed something. II. Sidebar ContentsI'm tinkering with this now - I'll post here when I know more. Note that there is possibly useful work happening over here for 1.5 with regards to system behavior for draft documents (doing a better job of excluding draft documents from websites and also likely making it easier to denote what documents are draft): I think I should have something ready pretty shortly that might make life a little easier. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Minimal repo: https://github.com/qmd-lab/quarto-class-website
I've run into some unexpected behavior in how paths are resolved when passed as metadata in separate yml files for a website. I see this in two different settings:
I. Including contents in a document listing through
contents.yml
file.II. Including extra sidebar contents in
_quarto.yml
by linking tosidebar-nav.yml
through themetadata-files
key.If
sidebar-nav.yml
is in the same directory as_quarto.yml
and ifcontents.yml
is in the same directory as the qmd with the listing, there are no problems. If they're in different directories, however, things go awry.I. Listing Contents
For example (and in the minimal repo)
slides.qmd
has a listing like this:where
slides-contents.yml
is just this:The wrinkle is that
slides.qmd
renders like this:Those thin cards are actually good clickable links, but it clearly failed to pull the metadata as the warning says:
If I change the paths to look like
/1-probability/1-random-variables/slides.qmd
, the warning changes to :If I change the path to
../../1-probability/1-random-variables/slides.qmd
, the document listing looks fine but the links no longer work, with the warning:Any idea what's going on here? It seems that the path resolution for the links is different than the path resolution for the metadata in a case where the .yml contents file is in a different directory than the listings qmd.
II. Extra Sidebar Nav Contents
My
_quarto.yml
looks like this:And
sidebar-nav.yml
looks like this:When the website renders, however, the sidebar only contains Home, Slides, and Problem Sets. Prepending the contents paths with either
/
or../../
doesn't appear to do anything and I get no warnings. It is fixed, though, by movingsidebar-nav.yml
into the same directory as_quarto.yml
.As far I can tell, this is not related to
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions