def call(env)
      request = Rack::Request.new(env)

      unless complete?
        return serve_wait_page(request)
      end

      filename = @files.get_filename(request.path_info)

      if filename
        media_type = Utils.media_type(filename)

        file = Utils.file_info(filename)
        body = file[:body]
        time = file[:time]
        hdrs = { "Last-Modified" => time }

        if time == request.env["HTTP_IF_MODIFIED_SINCE"]
          response = [304, hdrs, []]
        else
          hdrs.update({ "Content-Length" => body.bytesize.to_s,
                        "Content-Type"   => media_type })
          response = [200, hdrs, [body]]
        end

      else
        body = not_found_message
        hdrs = { "Content-Length" => body.bytesize.to_s,
                 "Content-Type"   => "text/html" }
        response = [404, hdrs, [body]]
      end

      request.head? ? remove_body(response) : response
    end
def call(env)
      request = Rack::Request.new(env)

      unless complete?
        return serve_wait_page(request)
      end

      filename = @files.get_filename(request.path_info)

      if filename
        media_type = Utils.media_type(filename)

        file = Utils.file_info(filename)
        body = file[:body]
        time = file[:time]
        hdrs = { "Last-Modified" => time }

        if time == request.env["HTTP_IF_MODIFIED_SINCE"]
          response = [304, hdrs, []]
        else
          hdrs.update({ "Content-Length" => body.bytesize.to_s,
                        "Content-Type"   => media_type })
          response = [200, hdrs, [body]]
        end

      else
        body = not_found_message
        hdrs = { "Content-Length" => body.bytesize.to_s,
                 "Content-Type"   => "text/html" }
        response = [404, hdrs, [body]]
      end

      request.head? ? remove_body(response) : response
    end
Initializes a new Rack::Jekyll site.

 Options:

 +:config+::      use given config file (default: "_config.yml")

 +:force_build+:: whether to always generate the site at startup, even
                  when the destination path is not empty (default: +false+)

 +:auto+::        whether to watch for changes and rebuild (default: +false+)

 +:wait_page+::   a page to display while pages are rendering (default: "templates/wait.html")

 Other options are passed on to Jekyll::Site.