<commit_before>
module Awestruct
  module Extensions
    module Partial

      def partial(path)
        page = site.engine.load_site_page( File.join( '_partials', path ) )
        page.content if ( page )
      end

    end
  end

end<commit_msg>support for partials parameters<commit_after>
module Awestruct
  module Extensions
    module Partial

      def partial(path, params = {})
        filename = File.join( '_partials', path )

        if !File.exists?( filename )
          puts "no file #{filename} to include"
          return nil
        end

        page = site.engine.load_site_page( filename )

        return nil if !page

        params.each do |k,v|
          page.send( "#{k}=", v )
        end if params

        page.content
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.08505154639175258, 'fraction_numerical': 0.0, 'mean_word_length': 1.965648854961832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4920339', 'n_tokens_mistral': 232, 'n_tokens_neox': 226, 'n_words': 70}