lib/sdk/post.js
function(key) {
    var bits = key.split('.');
    var value = item;
    for (var i = 0; i < bits.length; i++) {
      value = value[bits[i]];
      if (!value) return '';
    }
    if (!value) return '';
    if (typeof value === 'function') value = value();
    if (typeof value === 'number' && value < 10) {
      return '0' + value;
    }
    return value;
  }
function(key) {
    var bits = key.split('.');
    var value = item;
    for (var i = 0; i < bits.length; i++) {
      value = value[bits[i]];
      if (!value) return '';
    }
    if (!value) return '';
    if (typeof value === 'function') value = value();
    if (typeof value === 'number' && value < 10) {
      return '0' + value;
    }
    return value;
  }
function ( key ) { var bits = key . split ( '.' ) ; var value = item ; for ( var i = 0 ; i < bits . length ; i ++ ) { value = value [ bits [ i ] ] ; if ( ! value ) return '' ; } if ( ! value ) return '' ; if ( typeof value === 'function' ) value = value ( ) ; if ( typeof value === 'number' && value < 10 ) { return '0' + value ; } return value ; }
generate the destination of a post via permalink style
generate the destination of a post via permalink style