Class: Jekyll::StaticFile

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/static_file_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_pageObject

Convert this static file to a Page



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/jekyll/static_file_ext.rb', line 6

def to_page
  page = Jekyll::Page.new(@site, @base, @dir, @name)

  # For READMEs in .github or docs at root level, they should be the root index
  target_dir = if special_readme?
                 "/"
               else
                 File.dirname(url) + "/"
               end

  page.data["permalink"] = target_dir
  page
end