<commit_before>require "jekyll-auto-image/version"
require "jekyll"

module Jekyll
 
  #
  # Auto Image Generator
  # 
  # Sets {{page.image}} variable in liquid with the following fallback:
  #  
  #  1) image value in front matter
  #  2) first image in the post/pàge
  #  3) _config.yaml image default
  #  4) nothing (not set)
  #
  #  
  class AutoImageGenerator < Generator
 
    def generate(site)
      @site = site
      site.pages.docs do |page|
        img = get_image(page)
        page.data['image'] = img if img
      end
        # Now do the same with posts
      site.posts.docs do |post|
        img = get_image(post)
        post.data['image'] = img if img
      end
    end # generate
    
    #<commit_msg>Update jekyll-auto-image.rb<commit_after>require "jekyll-auto-image/version"
require "jekyll"

module Jekyll
 
  #
  # Auto Image Generator
  # 
  # Sets {{page.image}} variable in liquid with the following fallback:
  #  
  #  1) image value in front matter
  #  2) first image in the post/pàge
  #  3) _config.yaml image default
  #  4) nothing (not set)
  #
  #  
  class AutoImageGenerator < Generator
 
    def generate(site)
      @site = site
      site.pages.each do |page|
        img = get_image(page)
        page.data['image'] = img if img
      end
      # Now do the same with posts
      site.posts.docs do |post|
        img = get_image(post)
        post.data['image'] = img if img
      end
    end # generate
    
    #
{'fraction_non_alphanumeric': 0.09631147540983606, 'fraction_numerical': 0.00546448087431694, 'mean_word_length': 2.177874186550976, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3915863', 'n_tokens_mistral': 490, 'n_tokens_neox': 479, 'n_words': 147}