Skip to content

Commit

Permalink
Merge pull request #9 from k-funk/use-site-source-with-pages-dir
Browse files Browse the repository at this point in the history
Use #{site.source}/#{pages_dir} instead of just #{pages_dir}
  • Loading branch information
bbakersmith authored Mar 1, 2018
2 parents 2dfafd3 + 0ae3d0a commit 1abb41f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _plugins/jekyll-pages-directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module Jekyll
class PagesDirGenerator < Generator
def generate(site)
pages_dir = site.config['pages'] || './_pages'
all_raw_paths = Dir["#{pages_dir}/**/*"]
all_raw_paths = Dir["#{site.source}/#{pages_dir}/**/*"]
all_raw_paths.each do |f|

if File.file?(File.join(site.source, '/', f))
if File.file?(f)
filename = f.match(/[^\/]*$/)[0]
clean_filepath = f.gsub(/^#{pages_dir}\//, '')
clean_filepath = f.gsub(/^#{site.source}\/#{pages_dir}\//, '')
clean_dir = extract_directory(clean_filepath)

site.pages << PagesDirPage.new(site,
Expand Down

0 comments on commit 1abb41f

Please sign in to comment.