Skip to content

Commit

Permalink
The labels now show up and link to blogger! Styles are more consisten…
Browse files Browse the repository at this point in the history
…t between blogger and this site now, too.
  • Loading branch information
chadoh committed May 6, 2010
1 parent 40bdc2c commit 24c1fa0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
7 changes: 6 additions & 1 deletion partials.rb
Expand Up @@ -9,9 +9,14 @@ def partial(template, *args)
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)
if collection = options.delete(:collection) then
spacer_string = options.delete(:spacer_string)
collection.inject([]) do |buffer, member|
buffer << haml(:"#{template}", options.merge(:layout =>
rendered = haml(:"#{template}", options.merge(:layout =>
false, :locals => {template_array[-1].to_sym => member}))
if spacer_string
rendered << spacer_string if member != collection.last
end
buffer << rendered
end.join("\n")
else
haml(:"#{template}", options)
Expand Down
2 changes: 2 additions & 0 deletions views/_label.haml
@@ -0,0 +1,2 @@
%a{ :rel => "tag", :href => "http://lisayoder.blogspot.com/search/label/#{label.term}" }><
=label.term.strip
4 changes: 4 additions & 0 deletions views/_post.haml
Expand Up @@ -7,6 +7,10 @@
%div
%div(style="clear:both;")
= post.content
%div(style="clear:both; padding-bottom:0.25em")
%p.blogger-labels
Labels:
=partial :label, :collection => post.category, :spacer_string => ", "
%p.post-footer
%em
posted by Lisa at
Expand Down
14 changes: 12 additions & 2 deletions views/styles.sass
Expand Up @@ -154,13 +154,23 @@ p

.post
border-bottom: 1px dotted #aaa
margin: 0.5em 0
padding-bottom: 1.5em
margin: 0.5em 0 1.5em
padding-bottom: 0.5em
img
border: 1px solid #ddd
padding: 4px
div.blogger-post-footer
display: none
div
line-height: 1.6em
margin: 0 0 0.75em
ul
-webkit-padding-start: 40px
display: block
list-style-type: disc
margin: 1em 0
li
display: list-item

.post-title
color: #c60
Expand Down

0 comments on commit 24c1fa0

Please sign in to comment.