Created
May 6, 2015 08:05
-
-
Save jecisc/a4723c223e4f52293117 to your computer and use it in GitHub Desktop.
Example for the complex template of Guille (Pillar TODO list example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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