mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Not all "file" fields in `myst.yml` get resolved to absolute path

Open fwkoch opened this issue 1 year ago • 0 comments
trafficstars

Description

On loading myst.yml, we convert paths to absolute: https://github.com/executablebooks/mystmd/blob/main/packages/myst-cli/src/config.ts#L359 - this means we never have to worry about resolving relative paths later on when dealing with these fields.

However, we skip a few fields in the function linked above. When working with a single myst.yml in your current directory, this doesn't matter, as relative files will be correct, but when we start extending with other shared yml files in other directories, relative paths in those files fail.

I specifically noticed this for banner and thumbnail, but I think it also includes requirements, resources, download.url, site.action.url, site.project.path, possibly template fields if they are paths, export.articles.file maybe...

Proposed solution

I don't know if there will be any problems resolving any of these to absolute, maybe we can just add them all to the function linked above and it will just be fine. Diciest is probably template since that can be an id instead of a path (but for that we can just add an option to "ignore and not resolve things that don't exist as files")

fwkoch avatar Jun 29 '24 16:06 fwkoch