code: function postCompareFunc(a, b) {
    var sortType = option.get('sorttype');
    var diff = new Date(a.meta.pubdate) - new Date(b.meta.pubdate);
    return sortType === 'asc' ? diff : -diff;
  }
docs: compare two posts by pubdate