lib/awestruct/extensions/relative.rb in awestruct-0.4.6 vs lib/awestruct/extensions/relative.rb in awestruct-0.4.7
- old
+ new
@@ -1,11 +1,13 @@
require 'pathname'
module Awestruct
module Extensions
module Relative
- def relative(href)
- Pathname.new(href).relative_path_from(Pathname.new(File.dirname(page.output_path))).to_s
+
+ def relative(href, p = page)
+ Pathname.new(href).relative_path_from(Pathname.new(File.dirname(p.output_path))).to_s
end
+
end
end
end
\ No newline at end of file