<commit_before>require "rack/rewrite"
require 'rack/contrib/try_static'
require 'rack/contrib/not_found'
require 'rack/cache'
require 'dalli'

use Rack::Rewrite do
	rewrite '/feed/', '/rss.xml'
	rewrite '/blog/feed/', '/rss.xml'
    rewrite %r{/(.+)}, lambda {     |match, rack_env| 
        if File.exists?('_site/' + match[1] + '.html')
            return '/' + match[1] + '.html' 
        else
            return '/' + match[1]
        end
    }
end

$cache = Dalli::Client.new

use Rack::Cache,
  :verbose => true,
  :metastore => $cache,
  :entitystore => $cache

use Rack::TryStatic,
  :root => "_site",
  :urls => %w[/],
  :try  => ['index.html', '/index.html']
 
run Rack::NotFound.new('_site/404.html')<commit_msg>well this might be different maybe<commit_after>require "rack/rewrite"
require 'rack/contrib/try_static'
require 'rack/contrib/not_found'
require 'rack/cache'
require 'dalli'

use Rack::Rewrite do
	rewrite '/feed/', '/rss.xml'
	rewrite '/blog/feed/', '/rss.xml'
    rewrite %r{/(.+)}, lambda {     |match, rack_env| 
        if File.exists?('_site/' + match[1] + '.html')
            return '/' + match[1] + '.html' 
        else
            return '/' + match[1]
        end
    }
end

use Rack::Cache,
  :verbose => true,
  :metastore => :dalli_store,
  :entitystore => :dalli_store

use Rack::TryStatic,
  :root => "_site",
  :urls => %w[/],
  :try  => ['index.html', '/index.html']
 
run Rack::NotFound.new('_site/404.html')
{'fraction_non_alphanumeric': 0.19503790489317713, 'fraction_numerical': 0.008270158511371467, 'mean_word_length': 2.8927613941018766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '552332', 'n_tokens_mistral': 560, 'n_tokens_neox': 532, 'n_words': 116}