How to access website.title from _quarto.yml in a meta shortcode? #11270
Replies: 3 comments 1 reply
-
That's not currently possible in Quarto. |
Beta Was this translation helpful? Give feedback.
-
Thank you. But just out of general interest, why is it not possible, but other keys in _quarto.yml (like "tmp" in my example) are? The reason why I assumed it must be accessible is because when Quarto makes bibtex references for my blog posts, the url in the bibtex entry is composed of 'website.site-url' from _quarto.yml, plus the relative path of the blog post. In other words, that site-url nested key under the website key in _quarto.yml is being used somehow by Quarto to automatically generate the bibtex entry. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation. I can easily work around the problem I was facing by using information in |
Beta Was this translation helpful? Give feedback.
-
Description
I raised this question on Posit community forum but because I got no response in around 4 days, I assume the question is a bit too niche for that forum. Also, from what I can tell, this has not be raised before in other Issues or Discussions here.
I am using shortcodes in Quarto to try to access attributes in the
_quarto.yml
file. This works for some attributes and not others.Let's say I have simple Quarto project with just two files:
The contents of
_quarto.yml
are:Note that I made my own new attribute, for testing purposes,
tmp.something
. Sorry about the names, by the way.The contents of
index.qmd
areIf I render this, in the console output, I get
WARNING (C:/PROGRA~1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:17477) Unknown meta key website.title specified in a metadata Shortcode.
And the rendered html is
From this demo, I can access the title in the yaml header of the
index.qmd
itself, and I can access something from_quarto.yml
, namely thetmp.something
. But I can not accesswebsite.title
from_quarto.yml
.I am very puzzled by this because it seems like such as basic requirement, i.e. to access top level attributes like the website's title and so on.
I have tested on Linux (Arch) and Windows (11). I have tested in RStudio (2024-09-0 375 ;R: 4.4.1) and in the OS terminal. I am using Quarto 1.5.57.
Beta Was this translation helpful? Give feedback.
All reactions