georgi-shinmun 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/example/templates/post.rhtml +2 -2
- data/lib/shinmun/routes.rb +4 -0
- metadata +1 -1
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
<div style="margin:1em 0em 1em 0em; color:#666">
|
14
14
|
<% if @post.category %>
|
15
|
-
Posted in category <%= link_to @post.category, "/categories/#{urlify @post.category}
|
15
|
+
Posted in category <%= link_to @post.category, "/categories/#{urlify @post.category}" %> by <%= @blog.author %>.
|
16
16
|
<% end %>
|
17
|
-
Tagged with <%= @post.tags %>.
|
17
|
+
Tagged with <%= @post.tag_list.map {|tag| link_to tag, "/tags/#{urlify tag}" }.join(', ') %>.
|
18
18
|
</div>
|
19
19
|
|
20
20
|
<h6>Similar Posts</h6>
|
data/lib/shinmun/routes.rb
CHANGED
@@ -8,6 +8,10 @@ Shinmun::Blog.map do
|
|
8
8
|
render 'category.rhtml', find_category(category)
|
9
9
|
end
|
10
10
|
|
11
|
+
get '/tags/(.*)' do |tag|
|
12
|
+
render 'category.rhtml', :name => "Tag: #{tag}", :posts => posts.select { |p| p.tag_list.include?(tag) }
|
13
|
+
end
|
14
|
+
|
11
15
|
get '/(\d+)/(\d+)/(.*)' do |year, month, name|
|
12
16
|
post = find_post(year.to_i, month.to_i, name)
|
13
17
|
render 'post.rhtml', :post => post, :comments => comments_for(post.path)
|