IonicaBizau/ionicabizau.net — pull request #3 by IonicaBizau (2014-11-17 10:26:08+00:00)
Title: New version

Data format for new Bloggify version.

```js
var Moment = require("moment")
, Fs = require("fs")
, articles = require("./articles/posts.json")
, pages = require("./pages/pages.json")
, nArticles = []
, nPages = []
, i = 0
, c = null
;

for (i in articles) {
c = articles[i];
nArticles.push({
title: c.title
, slug: c.slug
, date: Moment(c.publishedAt, "DD-MM-YYYY")
, by: c.by
, id: c.id
, tags: c.tags
});
}

for (i in pages) {
c = pages[i];
nPages.push({
title: c.label
, slug: c.slug
, path: c.path
, order: c.order
});
}

Fs.writeFileSync("./articles/index.json", JSON.stringify(nArticles, null, 4));
Fs.writeFileSync("./pages/index.json", JSON.stringify(nPages, null, 4));
```