class Jekyll::PostFileGenerator
Public Instance Methods
copy_post_files(post)
click to toggle source
Copy the files from post's folder.
post - A Post which may have associated content.
# File lib/jekyll_post_files.rb, line 35 def copy_post_files(post) postpath = post.path postdir = File.dirname(postpath) destdir = File.dirname(post.destination("")) site = post.site sitesrcdir = site.source contents = Dir.glob(File.join(postdir, '**', '*')) do |filepath| if filepath != postpath filedir, filename = File.split(filepath[sitesrcdir.length..-1]) site.static_files << PostFile.new(site, sitesrcdir, filedir, filename, destdir) end end end
generate(site)
click to toggle source
Generate content by copying files associated with each post.
# File lib/jekyll_post_files.rb, line 53 def generate(site) Jekyll.logger.warn( "[jekyll_post_files]", "The jekyll_post_files plugin is deprecated. \ Please use the jekyll-postfiles plugin instead." ) site.posts.docs.each do |post| copy_post_files(post) end end