Skip to content

Commit

Permalink
Use site.in_source_dir as @mastahyeti suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Nov 4, 2014
1 parent b4a2788 commit 179b5ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/jekyll/draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def self.valid?(name)
end

# Get the full path to the directory containing the draft files
def containing_dir(source, dir)
Jekyll.sanitized_path(source, File.join(dir, '_drafts'))
def containing_dir(dir)
site.in_source_dir(dir, '_drafts')
end

# The path to the draft source file, relative to the site source
Expand Down
6 changes: 3 additions & 3 deletions lib/jekyll/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.valid?(name)
def initialize(site, source, dir, name)
@site = site
@dir = dir
@base = containing_dir(source, dir)
@base = containing_dir(dir)
@name = name

self.categories = dir.downcase.split('/').reject { |x| x.empty? }
Expand Down Expand Up @@ -88,8 +88,8 @@ def populate_tags
end

# Get the full path to the directory containing the post files
def containing_dir(source, dir)
return File.join(source, dir, '_posts')
def containing_dir(dir)
site.in_source_dir(dir, '_posts')
end

# Read the YAML frontmatter.
Expand Down

0 comments on commit 179b5ab

Please sign in to comment.