Repository navigation
include _quarto.yml if available - #11201
Conversation
|
cc @toph-allen, should this rather be the |
|
Alternatively, it could be a job for SEXP rs_quartoFileResources(SEXP targetSEXP)
{
std::vector<std::string> resources;
std::string target = r::sexp::safeAsString(targetSEXP);
if (!target.empty())
{
FilePath qmdPath = module_context::resolveAliasedPath(target);
json::Object jsonInspect;
Error error = quartoInspect(
string_utils::utf8ToSystem(qmdPath.getAbsolutePath()), &jsonInspect
);
if (!error)
{
jsonInspect["resources"].getArray().toVectorString(resources);
}
else
{
LOG_ERROR(error);
}
}
r::sexp::Protect protect;
return r::sexp::create(resources, &protect);
} |
Haven't seen an answer yet from @toph-allen, but I believe it should always be _quarto.yml in the root of the project directory, regardless of the exact location of the qmd file. I think even if your project has subfolders with quarto docs, you have just the one _quarto.yml with all the project level metadata at the root |
|
@jgutman I don't have an authoritative answer to this, sorry. I'd check the quarto.org docs maybe, or find ask closer to the Quarto project? The closest thing I can see to a section on _quarto.yml is this: https://quarto.org/docs/projects/quarto-projects.html#shared-metadata Seems like it is at project level, rather than dir. |
Thanks for the link! That seems to confirm my understanding that _quarto.yml is project level metadata and there should be only 1 per project. However, that link also reveals that there can be a directory level metadata file called _metadata.yml, which does live in the same subdirectly as the quarto doc to be published, and can contain additional metadata. @romainfrancois I think we should update this PR to 1) look for _quarto.yml in the project root, not the source file subdirectory, and 2) also look for a file called _metadata.yml in the source file subdirectory, and add that to the file list if it exists as well |
ccd3cf7 to
b596f65
Compare
|
Thanks @jgutman. Modified now so that it relies on quarto to tell what the project is, with With this hierarchy: I'm getting: The tests do stress more cases. |
This comment was marked as resolved.
This comment was marked as resolved.
|
cc @kevinushey because you might have some views on |
|
If the |
jgutman
left a comment
There was a problem hiding this comment.
LGTM although I'm not super familiar with the runQuarto({"inspect"...) part of it


Intent
addresses #10995
Approach
If a
_quarto.ymlfile is found in the same directory as the.qmdfile, then add it:Automated Tests
added this:
QA Notes
Checklist
NEWS.md