Skip to content

Instantly share code, notes, and snippets.

@jecisc
Created May 6, 2015 08:05
Show Gist options
  • Save jecisc/a4723c223e4f52293117 to your computer and use it in GitHub Desktop.
Save jecisc/a4723c223e4f52293117 to your computer and use it in GitHub Desktop.
Example for the complex template of Guille (Pillar TODO list example)
#myhtml.template
...
<ul>
{{# files }} <-- lists are already supported by mustache
<li><a href="{{outputfile}}">{{title}}</a></li>
{{/ files }}
</ul>
...
Files:
#File1.pillar
{{title:Mytitle}}
#File2.pillar
{{title:someotherTitle}}
Result:
<ul>
<li><a href="File1.html">MyTitle</a></li>
<li><a href="File2.html">someotherTitle</a></li>
</ul>
Guille made a proof of concept putting the data inside the pillar.conf as follows and it works.
"files" : [
{ "title" : "Home",
"url" : "index.html"
},
{ "title" : "Garage",
"url" : "garage.html"
},
{ "title" : "Contact",
"url" : "contact.html"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment