I would like to load an external yaml file in the yaml header of a qmd document (Quarto). I tried using !include <.yaml>
in my yaml header as described here, but this doesn’t seem to work. First I create a yaml file called external_yaml.yaml
:
author: Quinten
format: dashboard
Now I created a Quarto document called test_file.qmd
like this:
---
!include external_yaml.yaml
title: "Yaml with external yaml"
---
# Tab
This is a test
This returns an error:
ERROR: YAMLError: test_file.qmd:
unknown tag !<!include> at line 3, column 6:
title: "Yaml with external yaml"
^
Did you try to use a '!' in a YAML string? If so, you need to add explicit quotes to your string.
Stack trace:
unknown tag !<!include> at line 3, column 6:
title: "Yaml with external yaml"
^
Did you try to use a '!' in a YAML string? If so, you need to add explicit quotes to your string.
at generateError (file:///Applications/quarto/bin/quarto.js:10478:12)
at throwError (file:///Applications/quarto/bin/quarto.js:10481:11)
at composeNode (file:///Applications/quarto/bin/quarto.js:11348:20)
at readDocument (file:///Applications/quarto/bin/quarto.js:11411:5)
at loadDocuments (file:///Applications/quarto/bin/quarto.js:11446:9)
at load (file:///Applications/quarto/bin/quarto.js:11451:23)
at parse2 (file:///Applications/quarto/bin/quarto.js:11461:12)
at parseWithNiceErrors (file:///Applications/quarto/bin/quarto.js:19693:16)
at readYamlFromMarkdown (file:///Applications/quarto/bin/quarto.js:19624:17)
at markdownExecutionEngine (file:///Applications/quarto/bin/quarto.js:41167:20)
So I was wondering if anyone knows how we could add an external file in a yaml header of a quarto document?
Recognized by R Language Collective