Sha256: 38a73b690cfb0aa8cead86dac9584e80952b207299c39067889d028c380d663a
Contents?: true
Size: 993 Bytes
Versions: 12
Compression:
Stored size: 993 Bytes
Contents
module Plate # A static page is left unmodified and is transferred over to the published # site exactly as it is. class StaticPage < Page def file_path base = Pathname.new(File.join(self.site.source, 'content')) current = Pathname.new(self.file) dirs = current.relative_path_from(base) "/#{dirs}" end def layout nil end # If we need for some reason, read this file's contents def rendered_content @rendered_content ||= File.read(self.file) end # Write this page to the destination. For static files this just results # in copying the file over to the destination def write! path = File.join(site.build_destination, file_path) FileUtils.mkdir_p(File.dirname(path)) FileUtils.cp(self.file, path) end protected # Don't read any meta data for static files, leave them as-is. def read_metadata! self.meta = {} end end end
Version data entries
12 entries across 12 versions & 1 rubygems