Commits

Koen Van der Auwera committed 18f31bd

add stylesheet

Comments (0)

Files changed (2)

 end
 
 module Amanda::Controllers
+  class Style < R '/s/(.+)'
+    PATH = File.expand_path(File.dirname(__FILE__))
+    def get(path)
+      unless path.include? ".." # prevent directory traversal attacks
+        serve "#{path}", File.read("#{PATH}/s/#{path}")
+      else
+        @status = "403"
+        "403 - Invalid path"
+      end
+    end
+  end
+
   class Index < R '/'
     def get
       @last = STORE.last
   def layout
     doctype!
     html do
-      head { title { "AMANDA" } }
+      head do
+       title { "AMANDA" }
+       link rel: "stylesheet", type: "text/css", href: "/s/m.css"
+      end
       body do
         div.container! do
           div.header! { render_header }
   end
 
   def index
-    div.post! do
+    div.post! class: "last" do
       h2 @last.title
       div.content! { RDiscount.new(@last.content, :smart).to_html }
       div.meta! @last.id
+body {
+  background-color: #999;
+}