<commit_before>module SchnitzelPress
  module Actions
    module Blog
      extend ActiveSupport::Concern

      included do
        get '/' do
          # cache_for 5.minutes
          @posts = Post.latest.skip(params[:page].to_i * 10).limit(10)
          @show_description = true
          haml :index
        end

        get '/blog.css' do
          cache_for 1.hour
          scss :blog
        end

        get '/posts.atom' do
          cache_for 3.minutes
          @posts = Post.latest.limit(10)
          content_type 'application/atom+xml; charset=utf-8'
          haml :atom, :format => :xhtml, :layout => false
        end

        get '/feed/?' do
          redirect settings.feed_url
        end

        get %r{^/(\d{4})/(\d{1,2})/?$} do
          year, month = params[:captures]
          @posts = Post.latest.for_month(year.to_i, month.to_i)
          haml :index
        end

        get %r{^/(\d{4})/?$} do
          year = params[:captures].first
          @posts = Post.latest.for_year(year.to_i)
          haml :index
        end

        get '/:year/:month/:day/:slug/?' do |year, month, day, slug|
          @post = Post.
            for_day(year.to_i, month.to_i, day.to_i).
            where(slugs: slug).first

          render_post
        end

        get '/:slug/?' do |slug|
          @post = Post.where(slugs: slug).first
          render_post<commit_msg>Add daily archives<commit_after>module SchnitzelPress
  module Actions
    module Blog
      extend ActiveSupport::Concern

      included do
        get '/' do
          # cache_for 5.minutes
          @posts = Post.latest.skip(params[:page].to_i * 10).limit(10)
          @show_description = true
          haml :index
        end

        get '/blog.css' do
          cache_for 1.hour
          scss :blog
        end

        get '/posts.atom' do
          cache_for 3.minutes
          @posts = Post.latest.limit(10)
          content_type 'application/atom+xml; charset=utf-8'
          haml :atom, :format => :xhtml, :layout => false
        end

        get '/feed/?' do
          redirect settings.feed_url
        end

        get %r{^/(\d{4})/(\d{1,2})/(\d{1,2})/?$} do
          year, month, day = params[:captures]
          @posts = Post.latest.for_day(year.to_i, month.to_i, day.to_i)
          haml :index
        end

        get %r{^/(\d{4})/(\d{1,2})/?$} do
          year, month = params[:captures]
          @posts = Post.latest.for_month(year.to_i, month.to_i)
          haml :index
        end

        get %r{^/(\d{4})/?$} do
          year = params[:captures].first
          @posts = Post.latest.for_year(year.to_i)
          haml :index
        end

        get '/:year/:month/:day/:slug/?' do |year, month, day, slug|
          @post = Post.
            for_day(year.to_i, month.to_i, day.to_i).
            where(slugs: slug).first

          render_post
        end

        get '/:slug/?' do |slug|
          @post = Post.where(slugs: slug).first
          render_post
{'fraction_non_alphanumeric': 0.13223970539002344, 'fraction_numerical': 0.011047874121191832, 'mean_word_length': 1.5670103092783505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4804143', 'n_tokens_mistral': 1014, 'n_tokens_neox': 963, 'n_words': 213}