my problem in short: I am new to this static site things and have to use one of those two static site generators. I try to load data from JSON files and create sites on the server from that data. This is for a Webshop.
I googled a lot and found some code here ( which is in jade and won't work for me actually wanted to try it with EJS ) http://developer.telerik.com/featured/comparing-static-site-engines/
h2 Publications
each publication in public.publications._data
h3= publication.name
each article in publication.articles
p
a(href="#{article.URL}") #{article.title}
For me it is just prototyping and I try everything local on my PC. But I just can't figure EJS out. Someone with experience here who could lend me a hand? This reference is not helping much with harp and hexo: http://canjs.com/guides/EJS.html
My JSON Files look like this ( ATM could change them so they are all in 1 file if needed):
And this are the upper groups:
{
"groups" : [{
"id" : 13,
"name" : "Type1",
"filePrefix" : "000013",
"sortOrder" : 1
}, {
"id" : 12,
"name" : "Type2",
"filePrefix" : "000012",
"sortOrder" : 2
}, {
"id" : 10,
"name" : "Type3",
"filePrefix" : "000010",
"sortOrder" : 3
}, {
"id" : 11,
"name" : "Type4",
"filePrefix" : "000011",
"sortOrder" : 4
}, {
"id" : 2765,
"name" : "Type5",
"filePrefix" : "002765",
"sortOrder" : 5
}, {
"id" : 15,
"name" : "Type6",
"filePrefix" : "000015",
"sortOrder" : 6
}, {
"id" : 1958,
"name" : "Type7",
"filePrefix" : "001958",
"sortOrder" : 7
}
]
}
Here are the articles ( there are a lot more):
{
"products" : [{
"id" : 50000,
"groupId" : 1777,
"imageId" : 1777,
"sort" : "EPDM 00000213000000000021000000004200057040000000000045000005000000000770000000000006"
}, {
"id" : 60000,
"groupId" : 1652,
"imageId" : 1652,
"sort" : "EPDM 00000213000000000021000000004200057040000000000045000005000000000770000000000006"
}, {
"id" : 65644,
"groupId" : 186,
"imageId" : 186,
"sort" : "EPDM 00000269000000000026000000004200085280000000000045000005600000000830000000000006"
}]
}
Maybe there is someone who tried this and has some code to share? I just need an working example.
Thanks in advance! :)