Baby step: okay let's write some config stuff

I created the Blog type interface to describe blog metadata and define things like archive format. The idea here is to write a JSON config file that conforms to this interface:

{
    "title": "Scott Andrew",
    "url": "https://scottandrew.com",
    "description": "Scott Andrew makes stuff for the web, draws comics, and plays in bands. He thinks you're pretty cool.",
    "language": "en-US",
    "archiveFormat": "YearMonthDay",
    "archiveWithSlug": true,
    "indexPosts": 10,
    "authors" : [
        {
            "name": "Scott Andrew",
            "contact": "scottandrew@gmail.com",
            "urls" : [
                {
                    "title": "Link to scottandrew.com",
                    "text": "Website",
                    "url": "https://scottandrew.com"
                },
                {
                    "title": "Link to Twitter",
                    "text": "Twitter",
                    "url": "https://twitter.com/scottandrew"
                },
                {
                    "title": "Link to Instagram",
                    "text": "Instagram",
                    "url": "https://twitter.com/scottandrew"
                }
            ]
        }
    ]
}

As you can see I'm already scope creeping by supporting multiple authors. o_O

The next baby step is to just write a simple Node app that loads this config file and validates it.


Posted in: blogging, code, javascript, node

Previously: Let's start with some types

Next: Adventures in JS type checking