Hi All,
I’m new to Hugo so please pardon me if this question was already answered. I did try looking around discourse quite a bit but wasn’t able to find an answer.
I created a data file called quotes.json and it’s contents are:
{ “Robert” : {
“quote” : “Quote1”,
“name” : “Robert Heinlein”,
“book” :“Time Enough for Love”
},
“Charles” : {
“quote” : “Quote2”,
“name” : “Charles Buckowski”,
“book” : “Post Office”
}
}
Inside my layouts folder, I have an html file that does:
{{ range .Site.Data.quotes }}
{{ .quote}}
{{end}}
However, this displays value of “quote” for both “Robert” and “Charles”. How can I define it such that it only shows the value of the author I choose - for instance “Robert”.
Do I need to define a value in the front matter? Any assistance is much appreciated.
Thanks,
Shash