Accessing author metadata in shortcodes #2407
-
I'm trying to access the author information in a shortcode and I can't find a way to access it. I think it has to do with the changes the author lua filter does to the metadata, but I might be mistaken. My document has the following metadata :
I've tried dumping the Here's what my short shortcode code looks like for now: return {
["doc-source"] = function(args, kwargs, meta)
quarto.utils.dump(meta["author"])
return nil
end
} Any pointers on how I could proceed to get the necessary information? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The safest way should be to access https://quarto.org/docs/journals/authors.html Using this rather than access the Does this work? return {
["doc-source"] = function(args, kwargs, meta)
quarto.utils.dump(meta["authors"])
return nil
end
} |
Beta Was this translation helpful? Give feedback.
The safest way should be to access
meta['authors']
which should be present with a normalized schema described here (since we're normalizing the author into theauthors
key):https://quarto.org/docs/journals/authors.html
Using this rather than access the
author
key directly will give you the benefit of the author normalization that we do, ensuring that no matter how the user writes the author, you're able to access it consistently / predictably.Does this work?