Sha256: 73ca2d2eeabe60893a42a4dfcb8ea22c41065bfbc15342faf597b6c774097171
Contents?: true
Size: 597 Bytes
Versions: 14
Compression:
Stored size: 597 Bytes
Contents
require 'awestruct/util/exception_helper' require 'pathname' module Awestruct module Extensions module Relative def relative(href, p = page) begin # Ignore absolute links if href.start_with?("http://") || href.start_with?("https://") result = href else result = Pathname.new(href).relative_path_from(Pathname.new(File.dirname(p.output_path))).to_s end result rescue Exception => e ExceptionHelper.log_building_error e, p.relative_source_path end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems