lib/jekyll/site.rb in mojombo-jekyll-0.5.3 vs lib/jekyll/site.rb in mojombo-jekyll-0.5.4
- old
+ new
@@ -167,28 +167,27 @@
# Returns nothing
def transform_pages(dir = '')
base = File.join(self.source, dir)
entries = filter_entries(Dir.entries(base))
directories = entries.select { |e| File.directory?(File.join(base, e)) }
- files = entries.reject { |e| File.directory?(File.join(base, e)) }
+ files = entries.reject { |e| File.directory?(File.join(base, e)) || File.symlink?(File.join(base, e)) }
# we need to make sure to process _posts *first* otherwise they
# might not be available yet to other templates as {{ site.posts }}
if directories.include?('_posts')
directories.delete('_posts')
read_posts(dir)
end
-
+
[directories, files].each do |entries|
entries.each do |f|
if File.directory?(File.join(base, f))
next if self.dest.sub(/\/$/, '') == File.join(base, f)
transform_pages(File.join(dir, f))
elsif Pager.pagination_enabled?(self.config, f)
paginate_posts(f, dir)
else
first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
-
if first3 == "---"
# file appears to have a YAML header so process it as a page
page = Page.new(self, self.source, dir, f)
page.render(self.layouts, site_payload)
page.write(self.dest)