Merge pull request #5164 from jekyll/fix-windows-error

Merge pull request 5164
This commit is contained in:
jekyllbot 2016-08-01 17:34:52 -07:00 committed by GitHub
commit 6e0119d5e1
1 changed files with 4 additions and 10 deletions

View File

@ -11,6 +11,9 @@ module Jekyll
# Gets the path to this layout.
attr_reader :path
# Gets the path to this layout relative to its base
attr_reader :relative_path
# Gets/Sets the extension of this layout.
attr_accessor :ext
@ -37,6 +40,7 @@ module Jekyll
@base_dir = site.source
@path = site.in_source_dir(base, name)
end
@relative_path = @path.sub(@base_dir, "")
self.data = {}
@ -52,15 +56,5 @@ module Jekyll
def process(name)
self.ext = File.extname(name)
end
# The path to the layout, relative to the site source.
#
# Returns a String path which represents the relative path
# from the site source to this layout
def relative_path
@relative_path ||= Pathname.new(path).relative_path_from(
Pathname.new(@base_dir)
).to_s
end
end
end