Greetings,
I have read the datafiles and shortcode documentation, but I honestly don’t understand how to pass to a shortcode, as a parameter, which data file it should open. I have tried several combinations of {Params 0}, .Get etc in place of website1 below, without success.
The details: I have put in the data folder several .toml files, each containing a list of links from a website: website1.toml, website2.toml etc…
Each of those files has this content:
list = [
“Title of article1”,
“Title of article2”,
]
I have written a simplelist shortcode that does generate correctly an HTML list of the content of those files, when I call it like this "{{% simplelist %}}:
$ cat hugo/layouts/shortcodes/simplelist.html
-
{{ range .Site.Data.website1.list }}
- {{ . | markdownify }} {{ end }}
of course, as is the shortcode always and only lists the contents of website1, even if I call it like “{{% simplelist website2 %}}”
What is the syntax to use in the .Site.Data… call, to use as data file/table the string passed as parameter to a shortcode like that?
thanks