collections (params = {}) {
    return new Promise(
      (resolve, reject) => {
        if (this._isCached('collections')) {
          return resolve(this._cached('collections'))
        }

        this.logger.info(`Loading jekyll collections for: ${this.repoPath}`)

        this.config(params).then(config => {
          let pathPrefix = ''

          if (config['collections_dir']) {
            pathPrefix = config['collections_dir']
          }

          if (pathPrefix.trim() !== '' && !/\/$/.test(pathPrefix)) {
            pathPrefix += '/'
          }

          let collections = []

          if (config['collections']) {
            collections = Object.keys(config['collections']).map(collectionName => {
              return new Collection({
                jekyll: this,
                name: collectionName,
                path: `${pathPrefix}_${collectionName}`
              })
            })
          }

          resolve(this._cache('collections', collections))
        }).catch(reject)
      }
    )
  }
/**
   * Load collections for this Jekyll instance
   * @param {Object} [params] - Additional params (sent to github)
   * @returns {Promise<Array>} - Returns promise with array of Collections
   */
Load collections for this Jekyll instance
@param {Object} [params] - Additional params (sent to github)
@returns {Promise} - Returns promise with array of Collections
Load collections for this Jekyll instance @param { Object } [ params ] - Additional params ( sent to github ) @returns { Promise } - Returns promise with array of Collections
collections (params = {}) {
    return new Promise(
      (resolve, reject) => {
        if (this._isCached('collections')) {
          return resolve(this._cached('collections'))
        }
        this.logger.info(`Loading jekyll collections for: ${this.repoPath}`)
        this.config(params).then(config => {
          let pathPrefix = ''
          if (config['collections_dir']) {
            pathPrefix = config['collections_dir']
          }
          if (pathPrefix.trim() !== '' && !/\/$/.test(pathPrefix)) {
            pathPrefix += '/'
          }
          let collections = []
          if (config['collections']) {
            collections = Object.keys(config['collections']).map(collectionName => {
              return new Collection({
                jekyll: this,
                name: collectionName,
                path: `${pathPrefix}_${collectionName}`
              })
            })
          }
          resolve(this._cache('collections', collections))
        }).catch(reject)
      }
    )
  }
collections ( params = { } ) { return new Promise ( ( resolve , reject ) => { if ( this . _isCached ( 'collections' ) ) { return resolve ( this . _cached ( 'collections' ) ) } this . logger . info ( ` ${ this . repoPath } ` ) this . config ( params ) . then ( config => { let pathPrefix = '' if ( config [ 'collections_dir' ] ) { pathPrefix = config [ 'collections_dir' ] } if ( pathPrefix . trim ( ) !== '' && ! / \/$ / . test ( pathPrefix ) ) { pathPrefix += '/' } let collections = [ ] if ( config [ 'collections' ] ) { collections = Object . keys ( config [ 'collections' ] ) . map ( collectionName => { return new Collection ( { jekyll : this , name : collectionName , path : ` ${ pathPrefix } ${ collectionName } ` } ) } ) } resolve ( this . _cache ( 'collections' , collections ) ) } ) . catch ( reject ) } ) }
Load collections for this Jekyll instance
 @param {Object} [params] - Additional params (sent to github)
 @returns {Promise<Array>} - Returns promise with array of Collections
Load collections for this Jekyll instance @param { Object } [ params ] - Additional params ( sent to github ) @returns { Promise<Array > } - Returns promise with array of Collections