1

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! :)

rufreakde
  • 19
  • 4
  • There were no answers yet because your question is 1) complex and 2) not technically optimal. It's too complex because your task is unclear, "Webshops" normally run on capable systems like Magento and are ran by professionals. Your attempt at solution is not optimal, since static website engines are aimed at blogs, not "Webshops". Not to mention, going JSON route you will need auxiliary helper tools to keep them clean and maintainable. I'm telling that because I actually use JSON content for my templates. Yet I can't answer your question. – revelt Feb 20 '17 at 10:04

0 Answers0