Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ace::Item#permalink is now part of Ace, as well as Ace::Item#server_p…

…ath (formerly #local_link).
  • Loading branch information...
commit c8c5b692ce1d8e7f0362f56c480a6e94990ce04e 1 parent a84fde5
@botanicus authored
View
14 app/posts.rb
@@ -30,16 +30,6 @@ def output_path
File.join(dir, slug)
end
- def local_link
- absolute = self.output_path.sub(/^output\//, "")
- "/#{absolute}"
- end
-
- # TODO: Ace should provide this functionality
- def permalink
- "http://blog.101ideas.cz#{local_link}"
- end
-
def self.posts
Post.instances.sort do |post, another|
another.metadata[:created_at] <=> post.metadata[:created_at]
@@ -59,11 +49,11 @@ def excerpt
def rss_excerpt
excerpt.to_s.gsub(/<\/?[^>]*>/, "")
end
-
+
def pub_date
metadata[:created_at]
end
-
+
def tag_list
return 'no' if metadata[:tags].empty?
metadata[:tags].map { |tag|
View
14 app/rss.rb
@@ -12,14 +12,10 @@ def title
"Blog 101Ideas.cz"
end
- def permalink
- "http://blog.101ideas.cz/posts.rss"
- end
-
def posts
Post.posts
end
-
+
def pub_date
Time.now.utc.to_s
end
@@ -37,10 +33,6 @@ def title
"#{super}: IT"
end
- def permalink
- "http://blog.101ideas.cz/rss/it.rss"
- end
-
def posts
super.select do |post|
post.metadata[:category] == "IT"
@@ -59,10 +51,6 @@ def title
"#{super}: Self-Development"
end
- def permalink
- "http://blog.101ideas.cz/rss/self-development.rss"
- end
-
def posts
super.select do |post|
post.metadata[:category] == "self-development"
View
4 app/tags.rb
@@ -52,10 +52,6 @@ def slug
def output_path
"output/tags/#{self.slug}.html"
end
-
- def permalink
- "/tags/#{self.slug}.html"
- end
end
class TagPage
View
2  config.yml
@@ -1,2 +1,2 @@
title: ""
-base_url: ""
+base_url: "http://blog.101ideas.cz"
View
2  content/index.html.haml
@@ -3,5 +3,5 @@
- block(:body) do
- Post.posts.each do |post|
%h2
- %a{href: post.local_link}= post.metadata[:title]
+ %a{href: post.server_path}= post.metadata[:title]
~ post.excerpt
View
2  layouts/tag.html.haml
@@ -4,5 +4,5 @@
%h1== Tag #{item.name}
- item.posts.each do |post|
%h2
- %a{href: post.local_link}= post.metadata[:title]
+ %a{href: post.server_path}= post.metadata[:title]
= post.excerpt
Please sign in to comment.
Something went wrong with that request. Please try again.