-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index_files not copied to project.output-dir with certain markdown formats #11789
Comments
Why would You are also suppsed to use See https://quarto.org/docs/output-formats/hugo.html.
|
Sure, quarto injects code into the output that assumes that the index_files are going to be there: cat output/page/index.md
---
title: my title
---
<script src="index_files/libs/quarto-diagram/mermaid.min.js"></script>
<script src="index_files/libs/quarto-diagram/mermaid-init.js"></script>
<link href="index_files/libs/quarto-diagram/mermaid.css" rel="stylesheet" />
<figure class=''>
<pre class="mermaid mermaid-js">flowchart LR
A[start] --> B[end]
</pre>
</figure> The other markdown formats inject this same code but do the additional step of copying the
edit: I went updated my reprex code to set project I am unsure if the Hugo project details will turn out to be critical here. We see the same index_files behavior with But if some details about my use case with Hugo might be helpful, I can provide some more context. Hugo is indeed doing the HTML rendering for me as you suggest. The reason why I don't have project-type hugo is because I do not intend to manage a hugo blog with quarto, simply put. I am just using quarto to render individual files in some directory If I need project-type hugo to support the |
The documentation says:
If you don't, it's like asking things to go wrong. To properly use To be clear, I am not saying there is no bug. I am saying your example is by definition wrong, at least for |
For reference as it fits in: |
Thanks, I will examine this link |
@mcanouil I updated the reprex in my original post to add |
I believe the behavior you encounter may be specific to Hugo project. Let me try to explain. When working with Quarto and Hugo, Quarto is only meant to be used to generate .md version of the .qmd source. Hugo will still be the one to create the website following Hugo website structure. This sentence sums it up in our doc:
Quarto is not meant to move the files around as it is important to follow the Hugo expected structure of Leaf Bundle Our doc says
So in your example the expected results is
This way when Though there is an "External Directory" support where So I think |
Thanks for the reply @cderv. The "External directory" section is all I am trying to accomplish, nothing too fancy. Just rendering the qmds to .md and relocating the outputs according to the project variable. Hugo already controls rendering to HTML, as you say.
Just to clarify, are we in agreement that the current behavior (not moving the index_files) is a bug? Everything else is working predictably for me; other resource dirs are correctly located to the output dir (such as generated figures), it's just index_files that are not moved. Separate question... as I understand it, an output format like |
Yes we document that external dir should work with quarto project type hugo, and it is missing moving the
Hugo support is quite specific in quarto. Internaly, there are also some Lua processing associated to To be clear, Maybe we should try warn or disallow to be sure |
To clarify, |
Bug description
Hi folks.
I am rendering a document with
project.output-dir
specified in_quarto.yml
When some
index.qmd
contains a code block to generate someindex_files
, theindex_files
directory is not being copied to theoutput-dir
when certain output formats (likehugo-md
) are used.The
index_files
are correctly copied with other output formats (likepdf
orcommonmark
), so this is somehow format-specific.Steps to reproduce
note: this example was edited to reflect advice below about project.type = hugo
The code below replicates the issue for me on the following quarto version:
shows
1.6.40
.First let's make a .qmd that we will use.
I am using a small mermaid diagram as a code chunk that should generate dependencies in
index_files
.We put in
page
sub-directory.I will then use _quarto.yml files to vary the render behavior.
We save the output to
output
sub-directory.md
output behaves, as I understand, correctly.The
ls
output shows:Here is an example with
gfm
output.and now the
ls
command only showsindex.md
.And here is an example with
hugo-md
which also setsproject.type
tohugo
.again
ls
only showsindex.md
Expected behavior
As I understand, we should always expect
index_files
to appear in the output dir.Actual behavior
On my side, the following outputs place
index_files
in the output-dir:And these formats do not plaace
index_files
in the output dir:and that's all I have tested.
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: