gardr / validator

MIT License
3 stars 0 forks source link

Suggestion for site config #1

Closed trull closed 10 years ago

trull commented 10 years ago

We need to have separate options for different sites and devices on these sites.

Suggestion to structure:

{"sites": {
    "mobil-vg" : {
        "logo": "some/logo.png",
        "type" : {
            "default": {
                "viewport": [
                    {
                        "width": 468,
                        "height": 300
                    },
                    {
                        "width": 468,
                        "height": 200
                    },
                    {
                        "width": 468,
                        "height": 150
                    }
                ],
                "kbLimit": 50,
                "ignore" : [
                    "validator1",
                    "validator3"
                ],
                "allowRelativePaths": false
            },
            "tactus" :{
                "kbLimit": 125,
                "ignore" : [
                    "validator1",
                    "validator3"
                ],
                "allowRelativePaths": true
            }
        }
    }
}}
sveisvei commented 10 years ago

Our main task here should be to evolve the type options defaults/structure. The site structure in itself is fine and reflects the webapp.

Gist work-in-progress: https://gist.github.com/sveisvei/f93448ecb35ecb8aa2ae

leftieFriele commented 10 years ago

I got some detailed remarks about the config. Having the name of the site as a field seems odd, it should be a name property on a site and sites should be an array. This goes for mobil-vg and the tactus entry. Having them as names would make things easier to read and code. The type object is hard to determine what is, it should have a name which states what it actually is. I think the default should be a something like defaultConfig under site and then have a separate formats property (which would contain the things under "tactus".