<commit_before>###
# Blog settings
###

# Time.zone = "UTC"
activate :i18n, :mount_at_root => :fr
activate :middleman_simple_thumbnailer
activate :blog do |blog|
  # This will add a prefix to all links, template references and source paths
  blog.name = "en"

  blog.permalink = "en/post/{year}/{month}/{day}/{title}.html"
  # Matcher for blog source files
  blog.sources = "post/en/{year}-{month}-{day}-{title}.html"
  blog.taglink = "tag/{tag}.html"
  blog.layout = "post"
  blog.summary_separator = /READMORE/
  blog.taglink = "en/tag/{tag}.html"
  
  # blog.summary_length = 250
  blog.year_link = "{year}.html"
  blog.month_link = "{year}/{month}.html"
  blog.day_link = "{year}/{month}/{day}.html"
  # blog.default_extension = ".markdown"

  blog.tag_template = "tag_en.html"
  # blog.calendar_template = "calendar.html"

  # Enable pagination
  blog.paginate = true
  blog.per_page = 10
  blog.page_link = "page/{num}"
end

activate :blog do |blog|
  # This will add a prefix to all links, template references and source paths
  blog.name = "fr"
  blog.permalink = "post/{year}/{month}/{day}/{title}.html"
  # Matcher for blog source files
  blog.sources = "post/fr/{year}-{month}-{day}-{title}.html"
  blog.layout = "post"
  blog.summary_separator = /READMORE/
  blog.taglink = "tag/{tag}.html"
  # blog.summary_length = 250
  # blog.year_link = "{year}.html"
  # blog.month_link = "{year}/{month}.html"
  # blog.day_link = "{year}/{month}/{day}.html"
  # blog.default_extension = ".markdown"

  blog.tag_template = "tag_fr.html"
  # blog.calendar_template = "calendar.html"

  # Enable pagination
  blog.paginate = true
  blog.per_page = 10
  blog.page_link = "page/{num}"
end
set :casper, {
  blog: {
    url: 'http://fabbook.fr',
    name: 'Fabbook',
    description: 'Life and Dev',
    date_format: '%d %B %Y',
    navigation: true,
    logo: nil # Optional
  },
  author: {
    name: 'Fabien',
    bio: 'Developer by day, fighter and cook by night',
    location: 'Berlin',
    website: nil, # Optional
    gravatar_email: '<EMAIL>', # Optional
    twitter: 'https://twitter.com/FabbookFr'
  },
  navigation: {
    "The french cook" => "http://the-french-cook.com",
    "Fabphoto" => "http://fabphoto.fr",
    "Fabfight" => "http://fabfight.com"

  }
}


page '/sitemap.xml', layout: false

ignore '/partials/*'
ignore '/tag_en.html.haml'
ignore '/tag_fr.html.haml'


ready do
  langs.each do |locale|
    if locale == I18n.default_locale
      proxy "/author/#{blog_author.name.parameterize}.html", "/author.#{locale}.html", ignore: true do
        ::I18n.locale = locale
      end
    else
      
      proxy "/#{locale}/author/#{blog_author.name.parameterize}.html", "/author.#{locale}.html", ignore: true do
        ::I18n.locale = locale
      end
    end
  end
end

config = YAML.load_file("parameter.yml")
config.map do |key, value|
  if ENV[key.to_s]
    value = ENV[key]
  end
  config[key] = value
end<commit_msg>Refractor<commit_after>###
# Blog settings
###

# Time.zone = "UTC"
activate :i18n, :mount_at_root => :fr
activate :middleman_simple_thumbnailer
activate :blog do |blog|
  # This will add a prefix to all links, template references and source paths
  blog.name = "en"

  blog.permalink = "en/post/{year}/{month}/{day}/{title}.html"
  # Matcher for blog source files
  blog.sources = "post/en/{year}-{month}-{day}-{title}.html"
  blog.taglink = "tag/{tag}.html"
  blog.layout = "post"
  blog.summary_separator = /READMORE/
  blog.taglink = "en/tag/{tag}.html"
  
  # blog.summary_length = 250
  blog.year_link = "{year}.html"
  blog.month_link = "{year}/{month}.html"
  blog.day_link = "{year}/{month}/{day}.html"
  # blog.default_extension = ".markdown"

  blog.tag_template = "tag_en.html"
  # blog.calendar_template = "calendar.html"

  # Enable pagination
  blog.paginate = true
  blog.per_page = 10
  blog.page_link = "page/{num}"
end

activate :blog do |blog|
  # This will add a prefix to all links, template references and source paths
  blog.name = "fr"
  blog.permalink = "post/{year}/{month}/{day}/{title}.html"
  # Matcher for blog source files
  blog.sources = "post/fr/{year}-{month}-{day}-{title}.html"
  blog.layout = "post"
  blog.summary_separator = /READMORE/
  blog.taglink = "tag/{tag}.html"
  # blog.summary_length = 250
  # blog.year_link = "{year}.html"
  # blog.month_link = "{year}/{month}.html"
  # blog.day_link = "{year}/{month}/{day}.html"
  # blog.default_extension = ".markdown"

  blog.tag_template = "tag_fr.html"
  # blog.calendar_template = "calendar.html"

  # Enable pagination
  blog.paginate = true
  blog.per_page = 10
  blog.page_link = "page/{num}"
end
set :casper, {
  blog: {
    url: 'http://fabbook.fr',
    name: 'Fabbook',
    description: 'Life and Dev',
    date_format: '%d %B %Y',
    navigation: true,
    logo: nil # Optional
  },
  author: {
    name: 'Fabien',
    bio: 'Developer by day, fighter and cook by night',
    location: 'Berlin',
    website: nil, # Optional
    gravatar_email: '<EMAIL>', # Optional
    twitter: 'https://twitter.com/FabbookFr'
  },
  navigation: {
    "The french cook" => "http://the-french-cook.com",
    "Fabphoto" => "http://fabphoto.fr",
    "Fabfight" => "http://fabfight.com"

  }
}


page '/sitemap.xml', layout: false

ignore '/partials/*'
ignore '/tag_en.html.haml'
ignore '/tag_fr.html.haml'


ready do
  langs.each do |locale|
    if locale == I18n.default_locale
      proxy "/author/#{blog_author.name.parameterize}.html", "/author.#{locale}.html", ignore: true do
        ::I18n.locale = locale
      end
    else
      
      proxy "/#{locale}/author/#{blog_author.name.parameterize}.html", "/author.#{locale}.html", ignore: true do
        ::I18n.locale = locale
      end
    end
  end
end


config = YAML.load ERB.new(File.read('parameteryml')).result(binding)
{'fraction_non_alphanumeric': 0.1673849336321324, 'fraction_numerical': 0.006205826581623858, 'mean_word_length': 3.300963676797628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4952383', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2055, 'n_words': 452}