index.js
function renderPartial(name) {
      // The name is a required input.
      if (!name) {
        throw new Error('When calling .partial(), name is required.')
      }

      // Ensure the partial is available in the metadata.
      if (!(name in metalsmith.metadata().partials)) {
        throw new Error('The partial "' + name + '" was not found.')
      }

      // Construct the partial function arguments.
      const fnarray = []
      for (let i = 1; i < arguments.length; i++) {
        fnarray.push(arguments[i])
      }

      // Call the partial function with the given array arguments.
      return metalsmith.metadata().partials[name].apply(metalsmith.metadata(), fnarray)
    }
function renderPartial(name) {
      // The name is a required input.
      if (!name) {
        throw new Error('When calling .partial(), name is required.')
      }

      // Ensure the partial is available in the metadata.
      if (!(name in metalsmith.metadata().partials)) {
        throw new Error('The partial "' + name + '" was not found.')
      }

      // Construct the partial function arguments.
      const fnarray = []
      for (let i = 1; i < arguments.length; i++) {
        fnarray.push(arguments[i])
      }

      // Call the partial function with the given array arguments.
      return metalsmith.metadata().partials[name].apply(metalsmith.metadata(), fnarray)
    }
function renderPartial ( name ) { // The name is a required input. if ( ! name ) { throw new Error ( 'When calling .partial(), name is required.' ) } // Ensure the partial is available in the metadata. if ( ! ( name in metalsmith . metadata ( ) . partials ) ) { throw new Error ( 'The partial "' + name + '" was not found.' ) } // Construct the partial function arguments. const fnarray = [ ] for ( let i = 1 ; i < arguments . length ; i ++ ) { fnarray . push ( arguments [ i ] ) } // Call the partial function with the given array arguments. return metalsmith . metadata ( ) . partials [ name ] . apply ( metalsmith . metadata ( ) , fnarray ) }
Renders a partial from the given name.
Renders a partial from the given name .