Added Ace::Item#server_path and Ace::Item#permalink.

This commit is contained in:
Jakub Stastny aka botanicus 2011-03-03 14:54:42 +00:00
parent eb1715ae54
commit 8f7e2c0da2

View file

@ -115,6 +115,23 @@ module Ace
end end
end end
def server_path
absolute = self.output_path.sub(/^output\//, "")
"/#{absolute}"
end
def base_url
self.config[:base_url]
end
def permalink
if self.config[:base_url].nil?
raise "You have to add :base_url into config.yml or redefine #base_url method!"
end
"#{self.base_url}/#{self.server_path}"
end
attr_writer :output_path attr_writer :output_path
def output_path def output_path
@output_path ||= begin @output_path ||= begin