1. Koen Van der Auwera
  2. amanda

Commits

Koen Van der Auwera  committed 10d2043

add new! and random

  • Participants
  • Parent commits 6ca5b77
  • Branches master

Comments (0)

Files changed (3)

File amanda.rb

View file
  • Ignore whitespace
     end
   end
 
-  def render_post(post)
+  def render_post(post, desc=nil)
     div.post! do
-      h2 {a(href: URL(post.url).to_s, title: post.title) { post.title }}
+      h2 do
+        a(href: URL(post.url).to_s, title: post.title) { post.title }
+        span(class: "desc") { desc } if desc
+      end
       div.content! { post.html }
       div.meta! { render_meta(post) }
       div.tags! { render_tags(post.tags_to_arr) }
 
   def index
     div.post! class: "last" do
-      h2 {a(href: URL(@last.url).to_s, title: @last.title) { @last.title }}
+      h2 do
+        a(href: URL(@last.url).to_s, title: @last.title) { @last.title }
+        span(class: "desc") {"nieuw!"}
+      end
       div.content! { @last.html }
       div.meta! { render_meta(@last) }
       div.tags! {render_tags(@last.tags_to_arr) }
     end
     hr
-    render_post @random
+    render_post @random, "Random"
   end
 
   def single

File amanda/post.rb

View file
  • Ignore whitespace
       data = JSON.parse(data)
       post = Post.new
       %w(id title published date tags content slug).each do |attr|
-        post.send("#{attr}=", data[attr])
+        post.send("#{attr}=", data[attr].encode('iso-8859-1', 'utf-8')) if data[attr]
       end
       post
     rescue
 
     def self.parse(filename, contents="")
       post = Post.new(id_from_filename(filename))
-      contents = contents.force_encoding("ISO-8859-1").encode("utf-8", replace: nil)
+      contents = contents.force_encoding("iso-8859-1").encode("utf-8", replace: nil)
       contents.split("\n").each do |line|
         unless head = match_header(post, line)
           post.content << "\n#{line}" rescue post.content = line

File s/m.css

View file
  • Ignore whitespace
   width: 500px;
   margin: 0 auto;
   text-align: right;
+  text-transform: uppercase;
 }
 
 div#nav li {
   border-bottom: 2px solid #DBDADC;
   color: #363637;
   width: 350px;
+  text-transform: uppercase;
 }
 
 div#content h2 a, div#content h2 a:hover {
   text-decoration: none;
 }
 
+div#content h2 span.desc {
+  font-size: 0.7em;
+  font-weight: normal;
+  color: #FF007C;
+  margin-left: 1em;
+}
+
 div#content img {
   display: block;
   width: 500px;