Added Ace::Item#server_path and Ace::Item#permalink.
This commit is contained in:
parent
eb1715ae54
commit
8f7e2c0da2
1 changed files with 17 additions and 0 deletions
17
lib/ace.rb
17
lib/ace.rb
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue