File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed
Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 11---
22title: Upcoming Changes to Watcher and Star APIs
3+ published: 2012-9-5
4+ author: technoweenie
35---
46
7+ < %= render '_meta', :item => @item, :level => :h1 %>
8+
59We recently [changed the Watcher behavior][change-watching] on GitHub. What
610used to be known as "Watching", is now "Starring". Starring is basically
711a way to bookmark interesting repositories. Watching is a way to indicate that
Original file line number Diff line number Diff line change 1+ < < %= @level %> > < %= @item[:title] %> </ < %= @level %> >
2+ < div class ="meta ">
3+ < div class ="who_when ">
4+ < %= gravatar_for(@item[:author]) %>
5+ < span class ="author vcard fn ">
6+ < a href ="https://github.com/<%= @item[:author] %> "> < %= @item[:author] %> </ a >
7+ </ span >
8+ < span class ="published ">
9+ < %= post_date @item %>
10+ </ span >
11+ </ div >
12+ </ div >
Original file line number Diff line number Diff line change 11# All files in the 'lib' directory will be loaded
22# before nanoc starts compiling.
3+ include Nanoc ::Helpers ::Rendering
Original file line number Diff line number Diff line change @@ -21,6 +21,29 @@ module Helpers
2121 500 => '500 Server Error'
2222 }
2323
24+ AUTHORS = {
25+ :technoweenie => '821395fe70906c8290df7f18ac4ac6cf'
26+ }
27+
28+ def post_date ( item )
29+ pub = item [ :published ]
30+ if !pub . respond_to? ( :strftime )
31+ pub = Time . parse ( pub )
32+ end
33+ pub . strftime ( "%B %-d, %Y" )
34+ end
35+
36+ def gravatar_for ( login )
37+ %(<img height="16" width="16" src="%s" />) % gravatar_url_for ( login )
38+ end
39+
40+ def gravatar_url_for ( login )
41+ md5 = AUTHORS [ login . to_sym ]
42+ default = "https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
43+ "https://secure.gravatar.com/avatar/%s?s=20&d=%s" %
44+ [ md5 , default ]
45+ end
46+
2447 def headers ( status , head = { } )
2548 css_class = ( status == 204 || status == 404 ) ? 'headers no-response' : 'headers'
2649 lines = [ "Status: #{ STATUSES [ status ] } " ]
You can’t perform that action at this time.
0 commit comments