Sha256: c5257e60f99f193517a7ad532d7689bef99dfeb334322a64ebb253f9a31da769

Contents?: true

Size: 959 Bytes

Versions: 1

Compression:

Stored size: 959 Bytes

Contents

module Schreihals
  module Actions
    extend ActiveSupport::Concern

    included do
      before do
        refresh_documents! if refresh_documents_now?
        cache_control :public, :must_revalidate, :max_age => 60
      end

      get '/' do
        @posts = Post.latest(published_only: production?)

        @show_description = true
        haml :index
      end

      get '/blog.css' do
        scss :blog
      end

      get '/atom.xml' do
        @posts = Post.latest(published_only: production?)

        xml = haml :atom, :layout => false

        doc = Nokogiri::XML(xml)
        doc.css("content img").each do |node|
          node['src'] = absolutionize(node['src'])
        end

        content_type 'application/xml+atom'
        doc.to_xml
      end

      get '/:year/:month/:day/:slug/?' do |year, month, day, slug|
        render_page(slug)
      end

      get '/:slug/?' do |slug|
        render_page(slug)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
schreihals-0.0.3 lib/schreihals/actions.rb