Hi there,
I am trying to create a partial template which is to be used in list.html !I want to fetch some data inside my partial template from Data/config.json file!
My Data/config.json file looks like this:
{
“Accordion”: {
“name”: “Accordion”,
“version”: “3.20.1”,
“dependencies”: {
“Icon”: “Icon#~3.19.0”
}
},
“Button”: {
“name”: “Button”,
“version”: “3.20.2”,
“dependencies”: {
“Accordion”: “Accordion#~3.19.0”
}
}
}
I have a partial template(partial/importDepend.html) which looks like this:
{{ range $.Site.Data.config}}
{{ delimit .dependencies “,”}}
{{ end }}
and my default/list.html looks like :
{{if .Content}}
Now how can i fetch the “dependency” from JSON file for “Accordion” only when i have content/accordion.md and so forth for different file! Is there a thing where i can compare the fileName and the “name” key and show it accordingly?
Thanks!